MouseDown Event

14 May

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

Event MouseDown terjadi ketika user menekan tombol mouse ke bawah, pada saat user sedang aktif (focus) pada suatu form atau control. Syntax:

Private Sub object_MouseDown( 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 Form_MouseDown( Button As Integer, _
Shift As Integer, X As Single, _
Y As Single)
If Button = acLeftButton Then
MsgBox “You pressed the left button.”
End If
If Button = acRightButton Then
MsgBox “You pressed the right button.”
End If
If Button = acMiddleButton Then
MsgBox “You pressed the middle button.”
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: