KeyPressEventArgs Constructor (Char)


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Initializes a new instance of the KeyPressEventArgs class.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

public KeyPressEventArgs(
	char keyChar


Type: System.Char

The ASCII character corresponding to the key the user pressed.

Use the Control.ModifierKeys property to get the current state of the modifier keys.

The following example displays a message box that shows the current state of the SHIFT key.

.NET Framework
Available since 1.1
Return to top