Recently, a community member posted a question to the WindowsForms.NET site forums asking about the basic events that are fired in Forms and User Controls in Windows Forms applications. After digging through the MSDN documentation and various other sources (amazingly, it doesn't seem like the complete list is documented in any one place), I came up with the following:
Form Events:
-
Construtor
-
Load
-
Layout
-
Activated
-
Paint
-
Closing
-
Closed
-
Deactivate
-
Dispose
and for Controls:
-
Enter
-
GotFocus
-
Leave
-
Validating
-
Validated
-
LostFocus
I also discovered a code sample called EventSpy written by Urs Eichmann that you can use to view and filter the events to see in real time to see how your application is behaving. This is really helpful to use as you can see which events are fired and in what order as your application runs. Very cool!
Technorati Tags: windows forms, lifecycle events
Posted
04-17-2005 6:19 PM
by
paul.laudeman