Is that possible?
As I have a few popupmenus that are using the same shortcut, but appears on different forms. I get an error when assigning the same shortcut in the Menu Editor. So the only way is to do it during run-time.
Thanks
Harddisk
Printable View
Is that possible?
As I have a few popupmenus that are using the same shortcut, but appears on different forms. I get an error when assigning the same shortcut in the Menu Editor. So the only way is to do it during run-time.
Thanks
Harddisk
It is, using the API.
Ask Megatron how.
hi harddisk
i tested it and received no error!
is THAT possible?
cheers
u know u can delete your post...
thanks aron, i´m new to that thing.
hmmm......API again :(
To make an event happen when a key is pressed, use the KeyPress or KeyDown events.
Code:Private Sub Form_KeyPress(KeyAscii As Integer)
'if KeyAscii = ... Then...
MsgBox KeyAscii & Chr$(9) & Chr(KeyAscii)
End Sub
Private Sub Form_Load()
Me.KeyPreview = True
End Sub
And to have a menu and make it look like it has that big gap between, as a regular assigned shortcut would, use Chr$(9).
Code:MyMenu.Caption = "Help" & Chr$(9) & "F1"
Thanks Gates, that's just what I need.Quote:
MyMenu.Caption = "Help" & Chr$(9) & "F1"
Harddisk
this can also b done via api. i have the code on a book&cd, but its at work. if u pm me w/ ur email, i can email u the code
Thanks for the offer.Quote:
Originally posted by spetnik
this can also b done via api. i have the code on a book&cd, but its at work. if u pm me w/ ur email, i can email u the code
I think Matthew's suggestion is enough, it works great.
Just wanted to show the Shortcut for the user so that they know of the shortcut exists. It doesnt really work when the shortcuts are applied to context menu. :)
Harddisk