I want to override OnMouseClick and OnMouseDoubleClick and perform different actions depending on which click style was used.
The problem is that OnMouseClick is happening for both single and double clicks, and is getting called before OnMouseDoubleClick.
I'm certain this must be a common requirement, so I guess I'm missing something pretty obvious. Can someone fill me in?
Edit to add: the MouseEventArgs.Clicks count doesn't help. In the case of a double-click, the first click is handled as a single click in OnMouseClick with MouseEventArgs.Clicks == 1.
Edit to add: the objects are image thumbnails. Single click should toggle selection on and off for export. Double click should make the thumbnail full screen. The selection and "activation" actions are orthogonal. This may indicate an underlying problem with the two actions...
Cheers, Rob
That happens throughout Windows. I don't think they added anything special to handle it in .Net.
The normal means of handling this is
The amount of time you set the time for should be equal to the system's Double-Click time (which the user can specify in the control panel). It's available from System.Windows.Forms.SystemInformation.DoubleClickTime. The full details are in the MSDN, here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With