|
-
Oct 3rd, 2000, 04:08 AM
#1
Thread Starter
Member
how can i make hotkeys for graphical command buttons? I know its easy if i have a standard-command button (i will just have to use the ampersand & command right?) my command button does not use captions but i need to have a hotkey for it. Hope you guys can help me ASAP.
thanks
-
Oct 3rd, 2000, 08:04 AM
#2
Lively Member
Set Form1.KeyPreview to True
Paste this code into Form_KeyDown...
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
'This fires Command1_Click event if Shift + A is pressed...
If Shift = 1 Then
If KeyCode = 65 Then 'KeyCode 65 is "A"
Command1_Click 'Fires the Click event...
End If
End If
End Sub
Search for KeyCode in MSDN library to get all the code values...
Shift has (at least) these values)
1 = Shift
2 = Ctrl
4 = Alt
Somehow Alt Gr also is 1...
Hope this helps...
D
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|