|
-
Sep 28th, 2000, 11:40 AM
#1
Thread Starter
Lively Member
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.
-
Sep 28th, 2000, 11:49 AM
#2
Lively Member
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
-
Sep 28th, 2000, 11:52 AM
#3
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
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
|