Windows Forms Event Sequence

Windows Forms

When developing Windows applications using Windows Forms, you will most likely find yourself needing to make use of the form’s events, and this requires you to know when each form event fires. In this short reference article I will show you the sequence of the form events when the Form is being started and when it is being shut down.

Form Start up

Event Description
1. Control.HandleCreated Occurs when a handle is created for the control.
2. Control.BindingContextChanged Occurs when the value of the BindingContext property changes.
3. Form.Load Occurs before a form is displayed for the first time.
4. Control.VisibleChanged Occurs when the Visible property value changes.
5. Form.Activated Occurs when the form is activated in code or by the user.
6. Form.Shown Occurs whenever the form is first displayed.

Form Shutdown

Event Description
1. Form.Closing Occurs when the form is closing.
2. Form.FormClosing Occurs before the form is closed.
3. Form.Closed Occurs when the form is closed.
4. Form.FormClosed Occurs after the form is closed.
5. Form.Deactivate Occurs when the form loses focus and is no longer the active form.

Note that the Form.Closing and the Form.Closed events are obsolete in the .NET Framework version 2.0. You must use Form.FormClosing and Form.FormClosed instead.

Dave runs on the Thesis Theme

How smart is your Theme? How good is your support? Check out ThesisTheme for WordPress.

The Thesis Theme is one of the best Wordpress frameworks out there, especially if you understand software development, which since you're here you probably do. Thesis allows you to design post and page templates using a drag-and-drop system which gives you access to all the relevant page elements you would normally have to manually access through code. This is why understanding development techniques definitely helps, even though you don't need to write any code to get Thesis up and running.

So go check out the incredible features at DIYThemes and start using Thesis now!

0 comments… add one

Leave a Comment