ToolStripControlHost.OnKeyDown(KeyEventArgs) Method

Definition

Inicia el evento KeyDown.Raises the KeyDown event.

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

Parameters

e
KeyEventArgs

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

Remarks

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 OnKeyDown también permite que las clases derivadas controlen el evento sin adjuntar ningún delegado.The OnKeyDown 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.

Notes to Inheritors

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

Applies to