Skip to content

KeyPressEventArgs Class

Event arguments to indicate that a key is being pressed on a control that allows keyboard key cancelling.

C#
public class KeyPressEventArgs : EventArgs

Inheritance objectEventArgs

Creates a new event args object.

C#
public KeyPressEventArgs(AsciiKey key)

key AsciiKey
The key being pressed.

The key being pressed by the textbox.

C#
public readonly AsciiKey Key

When set to true, causes the textbox to cancel the key press.

C#
public bool IsCancelled { get; set; }