I just found out that there are 4 similarly names events for NotifyIcon
named Click
, DoubleClick
, MouseClick
and MouseDoubleClick
. The description text for them says
Occurs when the component is (double-)clicked [with mouse].
But what else can you click elements with except mouse?
I tried clicking it with mouse and pressing Enter after some tricky selection stuff with arrow keys and tabbing. Clicking with mouse fires both events, but pressing Enter only fires the Click
event.
What other differences are between these two pairs of events?
Assuming you're referring to WinForm Control events, from the MSDN documentation for Control.Click:
A click can be caused by not only a mouse click, but also some events
like a pressed key, etc.
The Click event passes an EventArgs to its event handler, so it only indicates that a click has occurred. If you need more specific mouse information (button, number of clicks, wheel rotation, or location), use the MouseClick event. However, the MouseClick event will not be raised if the click is caused by action other than that of the mouse, such as pressing the ENTER key.
The Click event passes an EventArgs to its event handler, so it only indicates that a click has occurred. If you need more specific mouse information (button, number of clicks, wheel rotation, or location), use the MouseClick event. However, the MouseClick event will not be raised if the click is caused by action other than that of the mouse, such as pressing the ENTER key.
Depressing a mouse button when the cursor is over a control typically raises the following series of events from the control:
- MouseDown event.
- Click event.
- MouseClick event.
- MouseUp event.
Source