Редагувати

Поділитися через


DataGrid.OnKeyDown(KeyEventArgs) Method

Definition

Raises the KeyDown event.

protected:
 override void OnKeyDown(System::Windows::Forms::KeyEventArgs ^ ke);
protected override void OnKeyDown (System.Windows.Forms.KeyEventArgs ke);
override this.OnKeyDown : System.Windows.Forms.KeyEventArgs -> unit
Protected Overrides Sub OnKeyDown (ke As KeyEventArgs)

Parameters

ke
KeyEventArgs

A KeyEventArgs that provides data about the OnKeyDown(KeyEventArgs) event.

Remarks

Raising an event invokes the event handler through a delegate. For more information, see Handling and Raising Events.

The OnKeyDown method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.

Notes to Inheritors

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