Click to See Complete Forum and Search --> : Be need'n some creative programmers here...
Inhumanoid
Nov 25th, 1999, 04:09 PM
Allright,
Think of any control that has a click event but does not have a doubleclick event...
I need youz to think of as many possible ways to mimic a double click event for this control...
have a good one :)
Crazy D
Nov 25th, 1999, 04:11 PM
Use the API to get the interval for the double-click (you can set it manually in the mouse control panel applet)
As soon as there's a click, set a timer to that interval and when that time is passed and there hasn't been clicked again, you know they didn't double-click...
The 0.2 should be replaced by the click time as specified in the control panel (but i was to lazy to look it up :) )
Private Sub Command1_Click()
Static dClick As Double
If dClick = 0 Then
'First Click"
dClick = Timer
ElseIf dClick + 0.2 > Timer Then
'Second Click inside timeframe"
MsgBox "Yeehaa"
dClick = 0
Else
'Second Click outside timeframe"
dClick = 0
End If
End Sub
------------------
Vincent van den Braken
EMail: azzmodan@azzmodan.demon.nl
ICQ: 15440110 (http://www.icq.com/15440110)
Homepage: http://www.azzmodan.demon.nl
with the first click, start a timer, with a second click, stop the timer, use a timer with a fast interval, and make it increment a counter on every cycle. if the counter is below a certain number, BINGO!.
------------------
Wossname,
Email me: wossnamex@talk21.com :)
Inhumanoid
Dec 7th, 1999, 03:58 PM
Azzmodan's looks like the best way to do it..
But it's a little buggy some of the time..
Sometimes the double click does not seem to get registered...
[This message has been edited by Inhumanoid (edited 12-08-1999).]
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.