text: Key
  Key Event Args Press
  Key Event Args Press
  Key Event Args Press
  Class
  Event Args
  Definition
  public ref class KeyPressEventArgs : EventArgs
  [System.Runtime.InteropServices.ComVisible(true)] public class KeyPressEventArgs : EventArgs
  type KeyPressEventArgs = class inherit EventArgs
  Public Class KeyPressEventArgs Inherits EventArgs
  - Inheritance
  -
  - Attributes
  -
  Examples; } };
  You must create a new instance of this class. You must also set the event handler. You can do this in the constructor for your class. ); }
  myKeyPressClass myKeyPressHandler = new myKeyPressClass(); public Form1() { InitializeComponent(); textBox1.KeyPress += new KeyPressEventHandler(myKeyPressHandler.myKeyCounter); }
  Private myKeyPressHandler As New myKeyPressClass() Public Sub New() InitializeComponent() AddHandler textBox1.KeyPress, AddressOf myKeyPressHandler.myKeyCounter End Sub 'New
  When the specified event is raised in the control, the attached method is called and the application can execute code in response to the event..
  Note
  Some controls will process certain key strokes on KeyDown. For example, RichTextBox processes the Enter key before KeyPress is called. In such cases, you cannot cancel the KeyPress event, and must cancel the key stroke from KeyDown instead.
  For information about the event model, see Handling and Raising Events.