System.Windows.Forms.Form.Closed Event

Occurs when the form is closed.

Syntax

[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
[System.ComponentModel.Browsable(false)]
public event EventHandler Closed

Remarks

Note:

The Form.Closed event is obsolete in the .NET Framework version 2.0; use the Form.FormClosed event instead.

This event occurs after the form has been closed by the user or by the Form.Close method of the form. To prevent a form from closing, handle the Form.Closing event and set the System.ComponentModel.CancelEventArgs.Cancel property of the System.ComponentModel.CancelEventArgs passed to your event handler to true.

You can use this event to perform tasks such as freeing resources used by the form and to save information entered in the form or to update its parent form.

Note:

The Form.Closed and Form.Closing events are not raised when the Application.Exit method is called to exit your application. If you have validation code in either of these events that must be executed, you should call the Form.Close method for each open form individually before calling the Application.Exit method.

If the form is an MDI parent form, the Form.Closing events of all MDI child forms are raised before the MDI parent form's Form.Closing event is raised. In addition, the Form.Closed events of all MDI child forms are raised before the Form.Closed event of the MDI parent form is raised.

For more information about handling events, see [<topic://cpconEventsOverview>].

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0