Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to assign different hotkeys for opening different folder locations or running different application by using short cut keys... can anyone help me in accomplishing this task, kindly provide me some exact code in VB.Net...
Posted

1 solution

You mean something like:
VB
Public Sub Form1_KeyPress(ByVal sender As Object, ByVal e As KeyPressEventArgs) Handles Me.KeyPress

        If e.KeyChar = Convert.ToChar(1) Then 'Ctrl-A 
        'Do something
        End If

        If e.KeyChar = Convert.ToChar(2) Then 'Ctrl-B 
        'Do something
        End If

        'etc....

End Sub
 
Share this answer
 
v2
Comments
shfitythrower 8-Dec-11 10:55am    
I want different hotkey for different actions, and can change them any time by assigning new keys for launching the same application or folder locations...is it possible using vb.net??
shfitythrower 8-Dec-11 11:06am    
Kindly guide that how can I assign new keys at runtime...
Scubapro 9-Dec-11 1:44am    
Take a look here: http://www.codeproject.com/KB/vb/mclhotkeynet.aspx

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900