Windows Forms Event LifeCycle
When deveploping windows forms app, it's important to understand the event lifecycle of a form. That way you know what code to put where to ensure it's loaded at the appropriate time. That being said I wrote a small app to detail the events in a basic windows form application. Greater indentations indicate nested events
Form Startup
- OnHandleCreated
- OnCreateControl
- OnLoad
- OnActivated
- OnShown
Form Shutdown
- OnClosing
- OnClosed
- OnDeactivate
- OnHandleDestroyed
Comments
- Anonymous
January 25, 2007
this is just great, i am thinking of deriving forms, thinking of which part ot put my init code at. Previously i place at OnLoad, but the forms seems slow while opening. Niw it works just fine.