keycode?

If you need help with a project or need to know how to do something specific in VB.NET then please ask your questions in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
6 posts Page 1 of 1
Contributors
User avatar
Dummy1912
VIP - Donator
VIP - Donator
Posts: 1969
Joined: Sat Aug 21, 2010 2:17 pm

keycode?
Dummy1912
Hello,

Love the new look codenstuff :D

i want to access Control + Alt + F1

but can't manage it

only works for 2 keycode noet 3 :(

any help please?

]code]
'Help
If (e.KeyCode = Keys.F1 AndAlso e.Modifiers = Keys.Control) Then
MsgBox("Ctrl+F1 for Help")
End If
'About
If (e.KeyCode = Keys.F1 AndAlso e.Modifiers = Keys.Control AndAlso e.Alt) Then
MsgBox("Ctrl+Alt+F1 for Help")
End If
[/code]

Search on Google but didn't find the solution

Thanks
visit us on:


http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
User avatar
CodenStuff
Site Admin
Site Admin
Posts: 4389
Joined: Tue Aug 04, 2009 1:47 am

Re: keycode?
CodenStuff
Try:
Code: Select all
    Private Sub Form1_KeyDown(sender As Object, e As KeyEventArgs) Handles Me.KeyDown
        If e.Control And e.Alt And e.KeyCode = Keys.F1 Then
            MsgBox("Ctrl+Alt+F1 for Help")
        End If

    End Sub
Welcome to CodenStuff.com Learn Code, Love Code. Thank you for being a member of the community.
User avatar
Dummy1912
VIP - Donator
VIP - Donator
Posts: 1969
Joined: Sat Aug 21, 2010 2:17 pm

Re: keycode?
Dummy1912
:teary; not working
visit us on:


http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
User avatar
Dummy1912
VIP - Donator
VIP - Donator
Posts: 1969
Joined: Sat Aug 21, 2010 2:17 pm

Re: keycode?
Dummy1912
seems weird, but when we use a character with control and alt it works fine
but when we use it with f1 its not working :duh;
Code: Select all
If e.Control And e.Alt And e.KeyCode = Keys.F1 Then
            MsgBox("Ctrl+Alt+F1 for Help") ' not working
        End If
Code: Select all
If e.Control And e.Alt And e.KeyCode = Keys.G Then
            MsgBox("Ctrl+Alt+G for Help") ' working  :darnit; 
        End If
do someone has a clue??
visit us on:


http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
User avatar
CodenStuff
Site Admin
Site Admin
Posts: 4389
Joined: Tue Aug 04, 2009 1:47 am

Re: keycode?
CodenStuff
I'm not sure why it's not working for you but the code I posted works fine for me.

Are you capturing keys anywhere else within your application?
Welcome to CodenStuff.com Learn Code, Love Code. Thank you for being a member of the community.
User avatar
Dummy1912
VIP - Donator
VIP - Donator
Posts: 1969
Joined: Sat Aug 21, 2010 2:17 pm

Re: keycode?
Dummy1912
no, just on the main form.
visit us on:


http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
6 posts Page 1 of 1
Return to “Coding Help & Support”