Form.OnFormClosing(FormClosingEventArgs) Form.OnFormClosing(FormClosingEventArgs) Form.OnFormClosing(FormClosingEventArgs) Form.OnFormClosing(FormClosingEventArgs) Method

Definición

Genera el evento FormClosing.Raises the FormClosing event.

protected:
 virtual void OnFormClosing(System::Windows::Forms::FormClosingEventArgs ^ e);
protected virtual void OnFormClosing (System.Windows.Forms.FormClosingEventArgs e);
abstract member OnFormClosing : System.Windows.Forms.FormClosingEventArgs -> unit
override this.OnFormClosing : System.Windows.Forms.FormClosingEventArgs -> unit
Protected Overridable Sub OnFormClosing (e As FormClosingEventArgs)

Parámetros

e
FormClosingEventArgs FormClosingEventArgs FormClosingEventArgs FormClosingEventArgs

Objeto FormClosingEventArgs que contiene los datos del evento.A FormClosingEventArgs that contains the event data.

Comentarios

Cuando se genera un evento, se invoca el controlador de eventos a través de un delegado.Raising an event invokes the event handler through a delegate. Para obtener más información, consulte controlar y provocar eventos.For more information, see Handling and Raising Events.

El método OnFormClosing también permite que las clases derivadas controlen el evento sin adjuntar ningún delegado.The OnFormClosing method also allows derived classes to handle the event without attaching a delegate. Ésta es la técnica preferida para controlar el evento en una clase derivada.This is the preferred technique for handling the event in a derived class.

Notas a los desarrolladores de herederos

Al reemplazar OnFormClosing(FormClosingEventArgs) en una clase derivada, asegúrese de llamar al método OnFormClosing(FormClosingEventArgs) de la clase base para que los delegados registrados reciban el evento.When overriding OnFormClosing(FormClosingEventArgs) in a derived class, be sure to call the base class's OnFormClosing(FormClosingEventArgs) method so that registered delegates receive the event.

Se aplica a

Consulte también: