DekGenius.com
[ Team LiB ] Previous Section Next Section

KeyPressEventArgs

System.Windows.Forms (system.windows.forms.dll)class

Similar to the KeyEventArgs, this class encapsulates the data for the Control.KeyPress event.

You can simply retrieve the KeyChar corresponding to the key that was pressed. For example, pressing Shift-H would provide H, whereas pressing H would return h (of course, the Caps Lock key would change this).

public class KeyPressEventArgs : EventArgs {
// Public Constructors
   public KeyPressEventArgs(char keyChar);
// Public Instance Properties
   public bool Handled{set; get; }
   public char KeyChar{get; }
}

Hierarchy

System.Object System.EventArgs KeyPressEventArgs

Passed To

Control.OnKeyPress(), KeyPressEventHandler.{BeginInvoke(), Invoke()}, UpDownBase.OnTextBoxKeyPress()

    [ Team LiB ] Previous Section Next Section