|
-
Dec 2nd, 2006, 09:33 PM
#1
Thread Starter
New Member
[RESOLVED] Mouse right click??
Hey I was wondering what the event is when the right mouse button is clicked.
Is this event included in mouseclick? If so do i have to make an if statement asking which mouse button has been pressed??
-
Dec 2nd, 2006, 10:05 PM
#2
Re: Mouse right click??
Use the MouseClick event and check to see which mouse button was clicked by using e.Button, something like
VB Code:
If e.Button = Windows.Forms.MouseButtons.Right Then
End If
-
Dec 2nd, 2006, 10:12 PM
#3
Thread Starter
New Member
Re: Mouse right click??
Could you use that in an example it seems to create errors with my handle and e.button appears undefined.
-
Dec 2nd, 2006, 10:20 PM
#4
Re: Mouse right click??
It's the "MouseClick" event of the control, not the "Click" event...
VB Code:
Private Sub Form1_MouseClick(ByVal sender As Object, _
ByVal e As System.Windows.Forms.MouseEventArgs) _
Handles Me.MouseClick
If e.Button = Windows.Forms.MouseButtons.Right Then
MsgBox("Right click detected")
End If
End Sub
-
Dec 2nd, 2006, 11:29 PM
#5
Re: Mouse right click??
The MouseClick event is new in .NET 2.0. If you're using .NET 1.x (please specify in future) you have to handle the MouseDown event instead.
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
|