_KeyPressEventArgs Type

Provides data for the OnKeyPress event.

Namespace: CNClrLib.Control.EventArgs
type
 _KeyPressEventArgs = CNClrLib.Windows._KeyPressEventArgs;

A KeyPressEventArgs specifies the character that is composed when the user presses a key. For example, when the user presses SHIFT + K, the KeyChar property returns an uppercase K.

A OnKeyPress event occurs when the user presses a key. Two events that are closely related to the OnKeyPress event are OnKeyUp and OnKeyDown. The OnKeyDown event precedes each OnKeyPress event when the user presses a key, and a OnKeyUp event occurs when the user releases a key. When the user holds down a key, duplicate OnKeyDown and OnKeyPress events occur each time the character repeats. One OnKeyUp event is generated upon release.

With each OnKeyPress event, a KeyPressEventArgs is passed. A KeyEventArgs is passed with each OnKeyDown and OnKeyUp event. A KeyEventArgs specifies whether any modifier keys (CTRL, SHIFT, or ALT) were pressed along with another key. (This modifier information can also be obtained through the ModifierKeys property of the Control class.)

For more information, see KeyPressEventArgs in C#.

Properties
Description

Handled

Gets or sets a value indicating whether the OnKeyPress event was handled.

KeyChar

Gets or sets the character corresponding to the key pressed.