PC Review


Reply
Thread Tools Rate Thread

How to differ single and double clicks?

 
 
Alexander Osipov
Guest
Posts: n/a
 
      29th Aug 2003
Hi!
I've got into trouble trying to place different actons on single and double
clicks in the TreeView nodes.

Unfortunately, the TreeView control fires both Click and DoubleClick events
sequentially when the user makes double click on some node and there is now
way to say at first Click event whether it is followed by DoubleClick or
not.
Playing with Control.SetStyle method and its StandardClick and
StandardDoubleClick flags does not affect the events sequence too.

Are there any ideas how to distinguish single and double clicks occured in
WinForms for to handle them in a different fashion?

Thanks for any advice,
Alex.


 
Reply With Quote
 
 
 
 
Justin Rogers
Guest
Posts: n/a
 
      29th Aug 2003
Beyond waiting some elapsed time, not really. Single clicks are normally
reserved for actions that wouldn't otherwise affect the action behind a
double click. That means single clicks should do selection, be used in
drag-drop scenarios, etc... Double clicks on the other hand should perform
launch actions, or other actions that are expected to take modality or need
to be exclusive.

Things start to get more confusing when you allow label editing (single
click, wait, single click).

So unless the single-click action is something that won't interfere with the
double click, or the single click action can be *rolled back* in case the
double click happens, you should re-think your design.


--
Justin Rogers
DigiTec Web Consultants, LLC.

"Alexander Osipov" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi!
> I've got into trouble trying to place different actons on single and

double
> clicks in the TreeView nodes.
>
> Unfortunately, the TreeView control fires both Click and DoubleClick

events
> sequentially when the user makes double click on some node and there is

now
> way to say at first Click event whether it is followed by DoubleClick or
> not.
> Playing with Control.SetStyle method and its StandardClick and
> StandardDoubleClick flags does not affect the events sequence too.
>
> Are there any ideas how to distinguish single and double clicks occured in
> WinForms for to handle them in a different fashion?
>
> Thanks for any advice,
> Alex.
>
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
single vs. double clicks Jim462002 Microsoft Outlook Discussion 5 31st Jul 2008 09:17 AM
Mouse double click on single clicks sometimes. =?Utf-8?B?TWljaGFlbCBDaW50YWRv?= Windows XP New Users 3 22nd Mar 2006 01:01 PM
Single clicks detected as double clicks =?Utf-8?B?Umlzc2EgQW5u?= Windows XP Help 4 27th May 2005 10:01 PM
Mouse double clicking on single clicks =?Utf-8?B?TWljaGFlbCBDaW50YWRv?= Windows XP Basics 0 28th Apr 2005 12:44 AM
Mouse double click on single clicks sometimes. =?Utf-8?B?TWljaGFlbCBDaW50YWRv?= Windows XP New Users 0 28th Apr 2005 12:42 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:50 AM.