Mouse Click Event

In .NET how can I capture what kind of mouse click I performed. Right? Left? Thumb? etc ...
LVL 5
thenrichAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Joe_GriffithConnect With a Mentor Commented:
I don't think you can for a "Click" event which can be raised in ways that don't involve the mouse.

You can however use one of the "Mouse" events like MouseDown.  

  Private Sub Label1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Label1.MouseDown
    If e.Button = MouseButtons.Right Then
      Beep()
    End If
  End Sub

The wheel is the middle button (not sure about rolling it however.
0
 
thenrichAuthor Commented:
thx, got what I was looking for
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.