What are the lifetime events of a form?
Some important lifetime events of a form include:
Load: This event is fired when the form is first loaded in the program. It is called when the Form.Show() or Form.ShowDialog() method is called for the first time.
Activated: This event is triggered whenever the form gets the application focus. It is fired when the form is first loaded (along with Load event), when the form is brought in front, or when the form is restored from the minimized state.
VisibleChanged: It is called whenever the Visible property of the form is changed or the form is hidden or shown.
Deactivated: This event is triggered whenever the form loses the application focus. It is fired when the form is closed, when the form is brought into background, or when the form is minimized.
Closing: It is fired when the application wishes to be closed, or the application is in the process of close but has not yet closed.
Closed: It is raised when the application is finally closed.
Index