Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

code for left mouse click

Status
Not open for further replies.

siebel2002

Programmer
Oct 8, 2001
102
US
Can anyone help me with a sample code for left & right mouse click event?

Thanks!

ftes
 
Have a look at the OnMouseMove event. This will trap mouse movements, including left right button clicks.

B ----------------------------------
Ben O'Hara
bo104@westyorkshire.pnn.police.uk
----------------------------------
 
hi Ben

Thx.

i did..but doesnt show how to trap the left click?!
 
For the left click, just use the

Private Sub YourSub_Click()
--
End Sub

That works fine. Catapultam habeo. Nisi pecuniam omnem mihi dabis, ad caput tuum saxum immane mittam.
 
Watch for the wraping:

Private Sub Detail_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = acLeftButton Then MsgBox "Left Button Clicked"
If Button = acRightButton Then MsgBox "right button clicked"
End Sub


HTH

Ben ----------------------------------
Ben O'Hara
bo104@westyorkshire.pnn.police.uk
----------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top