System.Windows.Forms.Form.FormClosed Event

Occurs after the form is closed.

Syntax

public event FormClosedEventHandler FormClosed

Remarks

The Form.FormClosed event occurs after the form has been closed by the user or by the Form.Close method or the Application.Exit method of the System.Windows.Forms.Application class. To prevent a form from closing, handle the Form.FormClosing 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.

If the form is a multiple-document interface (MDI) parent form, the Form.FormClosing events of all MDI child forms are raised before the MDI parent form's Form.FormClosing event is raised. Likewise, the Form.FormClosed events of all MDI child forms are raised before the Form.FormClosed event of the MDI parent form is raised.

For more information about handling events, see Consuming Events.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0