Click here to Skip to main content
15,914,905 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have notifyIcon with MouseClick and MouseDoubleClick events, the second action doesn't work, because single click performs first. And by default MouseClick prevents from using context menu. So need to separate this actions some-how.
Please, help.
Posted

That is just the way Click and DoublelClick events work:

Taken from MSDN:
A double-click is determined by the mouse settings of the user's operating system. The user can set the time between clicks of a mouse button that should be considered a double-click rather than two clicks. The Click event is raised every time a control is double-clicked. For example, if you have an event-handling methods for the Click and DoubleClick events of a Form, the Click and DoubleClick events are raised when the form is double-clicked and both methods are called. If a control is double-clicked and that control does not support the DoubleClick event, the Click event might be raised twice.


Please read all about it here: Control.DoubleClick Event[^]

Hope this helps, if you still have doubts please leave a comment to my answer.

Best Regards,
Manfred
 
Share this answer
 
v4
Comments
Nish Nishant 20-Jan-11 16:46pm    
More details than in my response. Take a 5.
When you double click the icon, MouseClick will fire and then MouseDoubleClick will fire. I presume that's what you are seeing.
 
Share this answer
 
Comments
Manfred Rudolf Bihy 20-Jan-11 16:45pm    
Yeah, about the same I pointed out to OP. 5+

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900