MouseMove Event

14 May

From:    “Sofyan Efendi” <sofyan@madinah.cc>
Date:    Tue, 22 Aug 2006 14:16:04 +0700

Event MouseMove terjadi saat user menggerakkan pointer mouse. Syntax:

Private Sub object_MouseMove( Button As Integer, Shift As Integer, X As Single, Y As Single)

Penjelasan:

– Object: Nama Form, Form section, atau control di dalam suatu Form.

– Button: TOmbol mouse yang ditekan. Isilah dengan constants sbb:

. acLeftButton -> The bit mask for the left mouse button.
. acRightButton -> The bit mask for the right mouse button.
. acMiddleButton The bit mask for the middle mouse button.

– Shift: Yakni penekanan tombol SHIFT, CTRL, dan ALT saat event ini dilakukan. Isilah dengan constants sbb:

. acShiftMask -> The bit mask for the SHIFT key.
. acCtrlMask -> The bit mask for the CTRL key.
. acAltMask -> The bit mask for the ALT key.

– X, Y: Yakni posisi koordinat x dan y mouse pointer pada object dalam satuan twips.

Contoh:

Private Sub Detail_MouseMove( Button As Integer, _
Shift As Integer, X As Single, Y As Single)
Dim intShiftDown As Integer, intLeftButton As Integer

Me!Coordinates. Caption = X & “, ” & Y
‘ Use bit masks to determine state of
‘ SHIFT key and left button.
intShiftDown = Shift And acShiftMask
intLeftButton = Button And acLeftButton
‘ Check that SHIFT key and left button
‘ are both pressed.
If intShiftDown And intLeftButton > 0 Then
MsgBox “Shift key and left mouse button were pressed.”
End If
End Sub

Wassalaamu’alaikum Warahmatullahi Wabarakatuh,
Sofyan Efendi
– AccessWeb <http://www35.websamba.com/accessweb&gt;
– OPI-Homepage <http://www.geocities.com/opi1978&gt;

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: