Handling a triple mouse click

  • Thread starter Thread starter SetonSoftware
  • Start date Start date
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
 
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"
 
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.
 
Start the form on the double click "Modal" this way all events to the parnet
window should be supressed

HTH

Michel
 
Back
Top