[Visual Basic .NET] |
---|
Public Sub KeyPress( _ ByRef KeyAscii As short _ ) As |
[C#] |
---|
public void KeyPress( ref short KeyAscii ); |
[Managed C++] |
---|
public: void KeyPress( short ^ KeyAscii ); |
[Java] |
---|
public void keyPress( short KeyAscii ); |
[Unmanaged C++] |
---|
public: void KeyPress( short * KeyAscii ); |
- KeyAscii
- An integer that returns a standard numeric ANSI keycode. KeyAscii is passed by reference; changing it sends a different character to the control. Changing KeyAscii to 0 cancels the keystroke so the control receives no character.
A KeyPress event can involve any printable keyboard character, the CTRL key combined with a character from the standard alphabet or one of a few special characters, and the ENTER or BACKSPACE key. A KeyPress event procedure enables you to immediately test keystrokes for validity or to format characters as they're typed. Changing the value of the KeyAscii argument changes the character received by the control.
KeyPress interprets the uppercase and lowercase of each character as separate key codes and, therefore, as two separate characters. KeyDown and KeyUp interpret the uppercase and lowercase of each character by means of two arguments: KeyCode, which indicates the physical key (thus returning A and a as the same key), and Shift, which indicates the state of shift+key and therefore returns either A or a.
In VB.NET the KeyPress event is shown as "xxxxxxxx_KeyPressEvent" in the IDE.
[Visual Basic .NET] | ||
---|---|---|
|