Type | Description | |||
KeyAscii as Integer | (By Reference) An integer that returns a standard numeric ANSI keycode |
The KeyPress event lets you immediately test keystrokes for validity or for formatting characters as they are typed. Changing the value of the keyascii argument changes the character displayed. Use KeyDown and KeyUp event procedures to handle any keystroke not recognized by KeyPress, such as function keys, editing keys, navigation keys, and any combinations of these with keyboard modifiers. Unlike the KeyDown and KeyUp events, KeyPress does not indicate the physical state of the keyboard; instead, it passes a character. KeyPress interprets the uppercase and lowercase of each character as separate key codes and, therefore, as two separate characters. Use the SelectItem property to get the index of the selected item. Use the SelectGroup property to get the index of the selected group.
Syntax for KeyPress event, /NET version, on:
private void KeyPress(object sender,ref short KeyAscii) { } Private Sub KeyPress(ByVal sender As System.Object,ByRef KeyAscii As Short) Handles KeyPress End Sub |
private void KeyPressEvent(object sender, AxEXLISTBARLib._IListBarEvents_KeyPressEvent e) { } void OnKeyPress(short FAR* KeyAscii) { } void __fastcall KeyPress(TObject *Sender,short * KeyAscii) { } procedure KeyPress(ASender: TObject; var KeyAscii : Smallint); begin end; procedure KeyPressEvent(sender: System.Object; e: AxEXLISTBARLib._IListBarEvents_KeyPressEvent); begin end; begin event KeyPress(integer KeyAscii) end event KeyPress Private Sub KeyPressEvent(ByVal sender As System.Object, ByVal e As AxEXLISTBARLib._IListBarEvents_KeyPressEvent) Handles KeyPressEvent End Sub Private Sub KeyPress(KeyAscii As Integer) End Sub Private Sub KeyPress(KeyAscii As Integer) End Sub LPARAMETERS KeyAscii PROCEDURE OnKeyPress(oListBar,KeyAscii) RETURN |
<SCRIPT EVENT="KeyPress(KeyAscii)" LANGUAGE="JScript"> </SCRIPT> <SCRIPT LANGUAGE="VBScript"> Function KeyPress(KeyAscii) End Function </SCRIPT> Procedure OnComKeyPress Short llKeyAscii Forward Send OnComKeyPress llKeyAscii End_Procedure METHOD OCX_KeyPress(KeyAscii) CLASS MainDialog RETURN NIL void onEvent_KeyPress(COMVariant /*short*/ _KeyAscii) { } function KeyPress as v (KeyAscii as N) end function function nativeObject_KeyPress(KeyAscii) return |