mathprof
asked on
Detecting a right mouse click in VB6
Of course in VB^ one can trap a mouse click. How can I distinguish whether it was a LEFT or a RIGHt mouse click?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
GREAT ! Thanks. It worked.
Prof Weissman
Prof Weissman
Happy to help. :-)
Private mousebutton As Integer
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
' remember which button was down
mousebutton = Button
End Sub
Private Sub Form_Click()
If mousebutton = vbLeftButton Then
MsgBox "Left click"
ElseIf mousebutton = vbRightButton Then
MsgBox "Right click"
End If
End Sub