Event Sequences


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.

Mouse Events

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

Resize Events

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.

Move Events

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.




Visual Basic 2005 with  .NET 3.0 Programmer's Reference
Visual Basic 2005 with .NET 3.0 Programmer's Reference
ISBN: 470137053
EAN: N/A
Year: 2007
Pages: 417

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net