Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / August 2006

Tip: Looking for answers? Try searching our database.

how to make a mouse double-click behave like a single-click

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Techsatish - 25 Aug 2006 16:42 GMT
Hi,

I have created a user control build over infragistics tree control and
this control is placed on a mdi form where on clicking on the node on
the tree control displays a new form on the right side.the problem i
get is when i make a single mouse click.it works fine ...i get the
right side form properly...but when i do mouse double click to the node
makes entry to the mouse click event handler twice for the control and
this resets the value in the form.

is there is any way to make a double-click behave like a single-click?

TIA
Satish
Stoitcho Goutsev (100) - 25 Aug 2006 22:43 GMT
Techsatish,

From what I understand you have inherited some control and you want to make
the control not to react on double click.

It depends on the base control implementation, but you may try adding to
your constructor the following line of code:

SetStyle(ControlStyles.StandardDoubleClick, false);

The control won't fire DoubleClick event, but I really doubt it will help.

Signature

HTH
Stoitcho Goutsev (100)

> Hi,
>
[quoted text clipped - 10 lines]
> TIA
> Satish
Doug Salomon - 28 Aug 2006 14:17 GMT
You can actually use the same event handler for both events.

In VB, assuming your single click event looks someting like this:
Private Sub MyControl_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyControl.Click

You can change it to something like:
Private Sub MyControl_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyControl.Click, MyControl.DoubleClick

In C#, I think you would need to use the Add Handler statement to add the
click event handler to the double click event). (I don't use C#, though, so
this is probably wrong in some way.)

Doug

> Hi,
>
[quoted text clipped - 10 lines]
> TIA
> Satish

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.