Dblclick Event of the Form's Control

I

Ilya

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

John Vinson

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.
 
B

Bas Cost Budde

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?
 
J

John Vinson

... 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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top