For developers who focus on processing events in the Windows Forms Application in order, the order of events is particularly important. When you need to handle events with caution in some cases (such as redrawing some parts of the form), you must know the exact sequence of events during running. This topic provides detailed information about the event sequence in several important phases of the application and control lifecycle. For more information about the sequence of mouse input events, see mouse events in Windows Forms. For an overview of events in Windows Forms, see event Overview (Windows Forms ). For more information about the composition of event handlers, see Event Handlers Overview (Windows Forms ).
Application startup and shutdown events
The Form and Control classes expose a group of events associated with application startup and shutdown. When a Windows form application is started, the startup events of the main form are triggered in the following order:
Control...:. HandleCreated
Control...:. BindingContextChanged
Form...:. Load
Control...:. VisibleChanged
Form...:. Activated
Form...:. Shown
When an application is closed, the closing event of the main form is triggered in the following order:
Form...:. Closing
Form...:. FormClosing
Form...:. Closed
Form...:. FormClosed
Form...:. Deactivate
The ApplicationExit event of the Application class is triggered after the closing event of the main form.
Note:
Visual Basic 2005 provides additional application events, such as WindowsFormsApplicationBase...:. Startup and WindowsFormsApplicationBase...:. Shutdown. For more information, see How to: Handle Application Events (Visual Basic ).
(From: http://msdn.microsoft.com/en-us/86faxx0d (zh-cn, VS.90). aspx)