aftab2003
asked on
F10 function key
Hi,
I have a VB prog with a menu.
I can assignt F5 to F12 shortcuts
to different menu item EXCEPT F10.
F10 is not shown in the shortcut
list of menu editor. How do I correct this.
I am using VB6 with service pack 5.
Thanks for your help
I have a VB prog with a menu.
I can assignt F5 to F12 shortcuts
to different menu item EXCEPT F10.
F10 is not shown in the shortcut
list of menu editor. How do I correct this.
I am using VB6 with service pack 5.
Thanks for your help
In the Form Load event write the following:
Me.KeyPreview = True
In Form Key Down:
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
if keycode= vbKeyF10 then
msgbox "F10 is pressed"
end if
End Sub
Me.KeyPreview = True
In Form Key Down:
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
if keycode= vbKeyF10 then
msgbox "F10 is pressed"
end if
End Sub
ASKER
Hi Sethi,
The code worked perfect. But at the same time it has activated "File" menu as mentioned by Bingie. Is there any way to avoid this ? like vbsendkey ?
Thanks for your help
The code worked perfect. But at the same time it has activated "File" menu as mentioned by Bingie. Is there any way to avoid this ? like vbsendkey ?
Thanks for your help
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You can still trap the key, just not assign it this way.