Interview Question
Qus: Explain the life cycle of a Winforms in .net?
1. Move: This event occurs when the form is moved. Although by default, when a form is instantiated and launched, the user does not move it, yet this event is triggered before the Load event occurs.
2. Load: This event occurs before a form is displayed for the first time.
3. VisibleChanged: This event occurs when the Visible property value changes.
4. Activated: This event occurs when the form is activated in code or by the user.
5. Shown: This event occurs whenever the form is first displayed.
6. Paint: This event occurs when the control is redrawn.
7. Deactivate: This event occurs when the form loses focus and is not the active form.
8. Closing: This event occurs when the form is closing.
9. Closed: This event occurs when the form is being closed.
2. Load: This event occurs before a form is displayed for the first time.
3. VisibleChanged: This event occurs when the Visible property value changes.
4. Activated: This event occurs when the form is activated in code or by the user.
5. Shown: This event occurs whenever the form is first displayed.
6. Paint: This event occurs when the control is redrawn.
7. Deactivate: This event occurs when the form loses focus and is not the active form.
8. Closing: This event occurs when the form is closing.
9. Closed: This event occurs when the form is being closed.
Load: When the form is loaded in into application.
Activate: When the form gets focused when it loads for the first time.
Deactivate: When the form is not focused or minimized or sent to background.
Closing: Before closing the application, this functionality is invoked.
Closed: When application is closed.
Disposed of: Garbage collection performs once the application is closed.