Visual Basic (Declaration) | |
---|---|
<SRCategoryAttribute("Key")> <SRDescriptionAttribute("Occurs when the control has focus and the user presses and releases a key.")> Public Event KeyPress As KeyPressEventHandler |
Visual Basic (Usage) | ![]() |
---|---|
Dim instance As CredentialsDialog Dim handler As KeyPressEventHandler AddHandler instance.KeyPress, handler |
C# | |
---|---|
[SRCategory("Key")] [SRDescription("Occurs when the control has focus and the user presses and releases a key.")] public event KeyPressEventHandler KeyPress |
C++/CLI | |
---|---|
[SRCategory("Key")] [SRDescription("Occurs when the control has focus and the user presses and releases a key.")] public: event KeyPressEventHandler^ KeyPress |
The event handler receives an argument of type KeyPressEventArgs containing data related to this event. The following KeyPressEventArgs properties provide information specific to this event.
Property | Description |
---|---|
Handled | Gets or sets a value indicating whether the System.Windows.Forms.Control.KeyPress event was handled. |
KeyChar | Gets or sets the character corresponding to the key pressed. |
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2