System.Windows.Forms.Form.OnClosed Method

Raises the Form.Closed event.

Syntax

[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)]
protected virtual void OnClosed (EventArgs e)

Parameters

e
The EventArgs that contains the event data.

Remarks

Note:

The Form.OnClosed(EventArgs) method is obsolete in the .NET Framework version 2.0; use the Form.OnFormClosed(FormClosedEventArgs) method instead.

Raising an event invokes the event handler through a delegate. For more information, see Raising an Event.

The Form.OnFormClosed(FormClosedEventArgs) method also allows derived classes to handle the event without attaching a delegate. Overriding this method is the preferred technique for handling the event in a derived class.

Note:

The Form.OnClosed(EventArgs) and Form.OnClosing(System.ComponentModel.CancelEventArgs) methods are not called when the Application.Exit method is called to exit your application. If you have validation code in either of these methods that must be executed, you should call the Form.Close method for each open form individually before calling the Application.Exit method.

Requirements

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