Several situations generate a series of events in a precise order.
Tip | There are a couple ways you can discover event sequences such as these. One is to place Debug .WriteLine statements in the event handlers so that you can see the events as they occur. Another method is to use the Spy++ tool to track events. For more information on that technique, see the article “Working with Windows Messages in .NET” by John Mueller at www.devsource.com/article2/ 0,1895,1961574,00.asp. |
When you click a control, the following events are raised in the order shown. The first instance of the MouseMove event can occur any number of times if you move the mouse while holding the mouse button down. The final MouseMove event occurs whether you move the mouse or not.
MouseDown
[MouseMove]
Click
MouseClick
MouseUp
MouseCaptureChanged
MouseMove
When you double-click a control, the following events are raised in the order shown.
MouseDown
[MouseMove]
Click
MouseClick
MouseUp
MouseCaptureChanged
MouseMove
MouseDown
DoubleClick
MouseDoubleClick
MouseUp
MouseCaptureChanged
MouseMove
When you resize a control, the following events are raised in this order. These events are repeated as long as you are resizing the control.
Layout
Resize
SizeChanged
Form controls also provide ResizeBegin and ResizeEnd events that occur before and after the other events, respectively.
When you move a control, the following events are raised in this order. These events are repeated as long as you are moving the control.
Move
LocationChanged
Form controls also provide ResizeBegin and ResizeEnd events that occur before and after the other events, respectively.