_KeyEventArgs Type
Provides data for the OnKeyDown or OnKeyUp event.
A 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 OnKeyDown or OnKeyUp event.
The OnKeyDown event occurs when the user presses any key. The
OnKeyUp event occurs when the user releases the key. Duplicate
OnKeyDown events occur each time the key repeats, if the key is
held down, but only one OnKeyUp event is generated when the user
releases the key.
The OnKeyPress event also occurs when
a key is pressed. A KeyPressEventArgs is passed with each KeyPress
event, and specifies the character that was composed as a result of
each key press.
For more information, see KeyEventArgs in C#.
Properties | Description |
---|---|
Alt | Gets a value indicating whether the ALT key was pressed. |
Control | Gets a value indicating whether the CTRL key was pressed. |
Handled | Gets or sets a value indicating whether the event was handled. |
KeyCode | Gets the keyboard code for a OnKeyDown or OnKeyUp event. |
KeyData | Gets the key data for a OnKeyDown or OnKeyUp event. |
KeyValue | Gets the keyboard value for a OnKeyDown or OnKeyUp event. |
Modifiers | Gets the modifier flags for a OnKeyDown or OnKeyUp event. The flags indicate which combination of CTRL, SHIFT, and ALT keys was pressed. |
Shift | Gets a value indicating whether the SHIFT key was pressed. |
SuppressKeyPress | Gets or sets a value indicating whether the key event should be passed on to the underlying control. |