Order of Events in Windows Forms

2008-07-07


1: Application Startup and Shutdown Events: Control.HandleCreated Control.BindingContextChanged Form.Load Control.VisibleChanged Form.Activated Form.Shown

When an application closes, the shutdown events of the main form are raised in the following order: Form.Closing Form.FormClosing Form.Closed Form.FormClosed Form.Deactivate

The ApplicationExit event of the Application class is raised after the shutdown events of the main form.

2: Focus and Validation Events:

When you change the focus by using the keyboard (TAB, SHIFT+TAB, and so on), by calling the Select or SelectNextControl methods, or by setting the ActiveControl property to the current form, focus events of the Control class occur in the following order:

  Enter
  GotFocus
  Leave
  Validating
  Validated
  LostFocus

When you change the focus by using the mouse or by calling the Focus method, focus events of the Control class occur in the following order:

  Enter
  GotFocus
  LostFocus
  Leave
  Validating
  Validated

(From Microsoft site: http://msdn.microsoft.com/en-us/library/86faxx0d.aspx)