System.Windows.Forms.KeyEventArgs Class

Provides data for the Control.KeyDown or Control.KeyUp event.

See Also: KeyEventArgs Members

Syntax

[System.Runtime.InteropServices.ComVisible(true)]
public class KeyEventArgs : EventArgs

Remarks

A System.Windows.Forms.KeyEventArgs, which specifies the key the user pressed and whether any modifier keys (CTRL, ALT, and SHIFT) were pressed at the same time, is passed with each Control.KeyDown or Control.KeyUp event.

The Control.KeyDown event occurs when the user presses any key. The Control.KeyUp event occurs when the user releases the key. Duplicate Control.KeyDown events occur each time the key repeats, if the key is held down, but only one Control.KeyUp event is generated when the user releases the key.

The Control.KeyPress event also occurs when a key is pressed. A System.Windows.Forms.KeyPressEventArgs is passed with each Control.KeyPress event, and specifies the character that was composed as a result of each key press.

For information about the event model, see [<topic://cpconEventsDelegates>].

Requirements

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