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

T

Techsatish

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
 
S

Stoitcho Goutsev \(100\)

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

Guest

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
 

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