Occurs when a character. space or backspace key is pressed while the control has focus.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Key events occur in the following order:
Use the KeyChar property to sample keystrokes at run time and to consume or modify a subset of common keystrokes.
To handle keyboard events only at the form level and not enable other controls to receive keyboard events, set the KeyPressEventArgs.Handled property in your form's event-handling method to true.
For more information about handling events, see Handling and Raising Events.
Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.