Function keys are a boon for assigning shortcuts. They have more advantage than the regular Alt +
Function keys can be assigned to command buttons using simple tricks as explained below. For that we need to instuct the VB to handle them in t
Then you can have the necessary shortcut keys on the form
In the Form_KeyDown event redirect to necessary functions/procs based on the key
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Select Case KeyCode
Case vbKeyF2
Call Proc_Fund_Transfer
Case vbKeyF3
Call Proc_Credit_Card
End Select
End Sub
I wanted to use function keys to move through a recordset displayed in a form. ANd the keydown event works with the keypreview property of the form set to true. HOWEVER, I used F10 and F9 as movenext and moveprevious
ReplyDeleteand when I look at the keycodes being generated , on of the funciton keys only regristers on EVERY-OTHER keydown event, yet the KEYUP event fires correctly. DOes anyone know why this would be or how to fix it.
Thanks!
I need to do this but in visual studio 2008, anyone can help me
ReplyDeleteCheck if the following helps you:
ReplyDeletehttp://dotnetdud.blogspot.com/2011/05/how-to-use-function-keys-in-vbnet.html
This one doesn't work for me. I've tried to use KeyDown event of my form. But the Sub is never called.
ReplyDeleteDoes work OK for me.
ReplyDeletethanks >>> much thanks
ReplyDelete