Board index » delphi » Differentiating Single-clicks from Double-clicks

Differentiating Single-clicks from Double-clicks

How can I tell if the user is single-clicking or doubleclicking in a
window. I want to take different actions depending on whether the user is
single-clicking or double-clicking. The problem is that when you
doubleclick a form for example, the OnClick, OnMouseDown and OnMouseUp
events get called first before the OnDoubleClick event is called. If the
user is double-clicking, I do not want to take the same actions as I would
under single-click circumstances...

--
Josef Garvi
Eden Foundation, BP 174, Zinder, Niger Republic
Tel:+227 510601, Fax:+227 510263
E-Mail: jo...@eden-foundation.org
WWW: http://www.eden-foundation.org/

 

Re:Differentiating Single-clicks from Double-clicks


Quote
> How can I tell if the user is single-clicking or doubleclicking in a
> window. I want to take different actions depending on whether the user is
> single-clicking or double-clicking. The problem is that when you
> doubleclick a form for example, the OnClick, OnMouseDown and OnMouseUp
> events get called first before the OnDoubleClick event is called. If the
> user is double-clicking, I do not want to take the same actions as I would
> under single-click circumstances...

Josef,

since a double click is invariably preceeded by a single click you simply
cannot do what you aim at doing. The only marginally workable solution would
be to start a timer on the single click that uses the double click time as
interval. If you see the timer event before the double click you know the
first click was a genuine single and can act on it, but with noticable
delay. Not something the user will take gracefully, i'm afraid.

Peter Below (TeamB)  100113.1...@compuserve.com)
No e-mail responses, please, unless explicitely requested!

Other Threads