Handling a triple mouse click

S

SetonSoftware

I have a VB.NET 2005 application which display rows in a DataGridView.
When the user double-clicks a row the CellDoubleClick event fires and
displays another form. This part works as it should. The problem is
when a user's finger gets jumpy and ends up triple-clicking a row. The
CellDoubleClick event still fires but additional events are also fired
that I can't easily trace. These events cause a chain reaction of
errors later on.

Does anyone know how I can intercept and suppress the third mouse-
click before it does any further damage?

Thanks

Carl
 
K

Ken Halter

If it were VB6, I'd suggest experimenting with the ReleaseCapture API...
Either way, you should be able to set a boolean flag somewhere that says
"Ignore all clicks until this operation is complete"
 
J

James Hahn

You need to take control of all mouse click events, and centralise the
processing in one procedure. Intercept each single click and use a timer and
a state machine to determine whether it's a single, double or triple click,
then process each as per your requirements.
 
M

Michel Posseth [MCP]

Start the form on the double click "Modal" this way all events to the parnet
window should be supressed

HTH

Michel
 

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