-
Howdy?
How can I distinguish between Click and DblClick events? I mean every time you click a mouse, the Click event is fired up. Also, if you do double-click, the Click event will be fired up first and then DblClick event will be fired up later. Does it has any way to avoid Click event when want to use only DblClick event? Or any suggestions? Thanks in advance.
-
That might be difficult to do but I do know the
MSFlexGrid1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single) Event is fired before the both of them.
I guess it depends on what you are trying to do. You might have to manipulate within these events to determine what you are trying to do.
If there is anyway I can help let me know.
bontyboy
-
One method would be to defer the Click event to a Timer giving you a chance to see if there is a follow up 2nd click, i.e.
Code:
Private bDblClick As Boolean
Private Sub MSFlexGrid1_Click()
'Defer the Event to the Timer, giving us time to make sure it's a single click
'Alter this value to tweak sensitivity
Timer1.Interval = 100
End Sub
Private Sub MSFlexGrid1_DblClick()
'Indicate that this is a Double Click
bDblClick = True
MsgBox "Double Click"
End Sub
Private Sub Timer1_Timer()
'Stop the Timer and if a 2nd Click hasn't been Detected then
'Execute some Single Click code.
Timer1.Interval = 0
If Not bDblClick Then
MsgBox "Click"
End If
bDblClick = False
End Sub