Allows derived classes to modify the default behavior of the KeyDown event.
Visual Basic .NET Overrides Protected Sub OnKeyDown( _
ByVal e As KeyEventArgs _
C# protected override void OnKeyDown(
Managed C++ protected: void OnKeyDown(
e System.Windows.Forms.KeyEventArgs. The KeyEventArgs object that contains the event data.
Raising an event invokes the event handler through a delegate.
The OnKeyDown method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
When overriding this method in a derived class, call the OnKeyDown method of the base class so that registered delegates receive the event.