KeyPressEventArgs Constructor (Char)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com 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
)

Parameters

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
Show: