For my listview control, the Doubleclick event fires when a users a left doubleclicks an item. But it also fires when the user right doubleclicks an item... i dont want this to happen. How do i detect left and right doubleclicks?
Because the DoubleClick event of the ListView does not provide any mouse information, you will need to catch the mouse button prior to the DoubleClick event firing:
Private bRight As Boolean
Private Sub ListView1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles ListView1.MouseDown
This is another easy way to do this just move your code from your listview_doublclick to the listview_mousedown and put it inside this control structure.
If e.Button = MouseButtons.Left And e.Clicks = 2 Then
'insert listview_doubleclicked code here
End If
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.