N
Nancy
My understanding is that MouseButtons should return which mouse button has
been pressed. This method exists in the Control class. However, None is
always returned as the value when left or right button pressed, and I don't
know why. I get the same results using any of the following syntax:
MouseButtons, Me.MouseButtons, Panel1.MouseButtons. I'm clicking on a panel
located on a form. Is this a bug?
Private Sub Panel1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Panel1.Click
Select Case MouseButtons
Case MouseButtons.Left
Debug.WriteLine("Left mouse button pressed.")
Case MouseButtons.Right
Debug.WriteLine("Right mouse button pressed.")
Case MouseButtons.None
Debug.WriteLine("None mouse button detected.") '<-- always get
this response
Case Else
Debug.WriteLine("It doesn't know which mouse button was
pressed.")
End Select
End Sub
been pressed. This method exists in the Control class. However, None is
always returned as the value when left or right button pressed, and I don't
know why. I get the same results using any of the following syntax:
MouseButtons, Me.MouseButtons, Panel1.MouseButtons. I'm clicking on a panel
located on a form. Is this a bug?
Private Sub Panel1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Panel1.Click
Select Case MouseButtons
Case MouseButtons.Left
Debug.WriteLine("Left mouse button pressed.")
Case MouseButtons.Right
Debug.WriteLine("Right mouse button pressed.")
Case MouseButtons.None
Debug.WriteLine("None mouse button detected.") '<-- always get
this response
Case Else
Debug.WriteLine("It doesn't know which mouse button was
pressed.")
End Select
End Sub