|
-
Nov 10th, 2000, 03:18 PM
#1
Thread Starter
Junior Member
Hello, Does anyone know how to capture a right-click event button from the mouse. For example, I have a DataGrid full of info and when the user selects a row and right clicks, I want to open another form. Is there a way I can code the right mouse button, or even better, on a 3-button mouse how would I capture each buttons click event? Thanks in advance.
-
Nov 10th, 2000, 03:21 PM
#2
Fanatic Member
Query the button argument of the event.
-
Nov 10th, 2000, 03:25 PM
#3
Thread Starter
Junior Member
Could you be a little more specific? perhaps a line of code example. Thanks!
-
Nov 10th, 2000, 03:25 PM
#4
Use the MouseDown or MouseUp event.
Code:
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbRightButton Then MsgBox "Right Button pressed"
If Button = vbMiddleButton Then MsgBox "Middle Button pressed"
If Button = vbLeftButton Then MsgBox "Left Button pressed"
End Sub
-
Nov 10th, 2000, 03:27 PM
#5
Fanatic Member
Sorry that my explanation was a little bad. I'm lazy today...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|