Mehram
asked on
VB 6 ASCII Code F1
Sir, In text box I want if user press F1 key the listbox form POP up. And what is ASCII code of F1
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You have to set the form KeyPreview = True
... and change to KeyDown event where you use the Keycode
ASKER
I have past code into the KeyDown event however could you guide my how could set kepreview = true?
I thought 112 is the VB code and that decimal 112 equates to the 'p' character? If wrong I apologise but if you are using Visual studio i.e. not vba then I suspect you need to use the keycode parameter from key up or key down event and check that for equivalence to vbkeyf1.
Chris
Chris
ASKER
no 112 is equivalent to f1 on key code and it is working after changing word keyascii to keycode however i just want to know to to set keypreview true
Select the form on the design mode and on the properties windows select keypreview = true.
But thats only for capture the form events. In the textbox you don't need it.
But thats only for capture the form events. In the textbox you don't need it.
ASKER
Thanks Sir
ASKER
Private Sub TxtBillOfLadingNo_KeyPress
If KeyAscii = 112 Then
Form1.Show
End If
End Sub