Dblclick Event of the Form's Control

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi Everybody
Is any smart way to prevent for sure "single click" event execution when making dblclick
Thanks in advance, Ilya.
 
Hi Everybody:
Is any smart way to prevent for sure "single click" event execution when making dblclick?
Thanks in advance, Ilya.

This is a longstanding problem. As far as I know, you can't. The Click
event fires BEFORE the doubleclick has been completed. By the time you
know it was a doubleclick it's too late.
 
John said:
This is a longstanding problem. As far as I know, you can't. The Click
event fires BEFORE the doubleclick has been completed. By the time you
know it was a doubleclick it's too late.

.... setting a global boolean in the _Click as a sign that a click was
'requested, with some timestamp: abuse the Timer event (100ms will do, I
guess, but it does depend on the OSs setting for a double click); in
_DblClick, clear that boolean; in the resulting Timer, check whether the
flag is high, and execute appropriately.

Would that work?
 
... setting a global boolean in the _Click as a sign that a click was
'requested, with some timestamp: abuse the Timer event (100ms will do, I
guess, but it does depend on the OSs setting for a double click); in
_DblClick, clear that boolean; in the resulting Timer, check whether the
flag is high, and execute appropriately.

Would that work?

Eeeeuuuwww.. timer hacks... <g>

Clever suggestion, and with some tuning it would probably work!
 
Back
Top