Page 1 of 1

how to add hotkeys to ur app

Posted: Tue Nov 24, 2009 2:51 am
by Robby
first of all what u do is get a button or somethin then go to its property`s and u will see shortcutkeys. just open it and set the keys and you do not need any timrs or codr so yea try it out. sorry for bad langage like misspellling . im writing from dsi. its hard to wrte:( if u want the code way then i will right it tomo since im not on my pc now and it gonna take forrvrr bye;)

Re: how to add hotkeys to ur app

Posted: Sun Nov 29, 2009 12:38 am
by NoWayIn
what?

Re: how to add hotkeys to ur app

Posted: Sun Nov 29, 2009 5:43 am
by Robby
lol that is how ot add hotkeys instead of writing the keypreview codE :D

Re: how to add hotkeys to ur app

Posted: Sun Nov 29, 2009 7:12 am
by NoWayIn
I didn't get it at all, rewrite it when you're on your computer please.
and I like the KeyPreview, it's easy

Re: how to add hotkeys to ur app

Posted: Sun Nov 29, 2009 4:54 pm
by Robby
ok so if u want the keypreview thingy then just do is like go to ur form1 properties and not the form1_load like the one in the right side and find keypreview and enable it to true.

The nwhat u do is use the command below

in any of ur button or like component keydown option put thijs code in


if e.keycode= keys.alt+keys.controlkey then
'do something hear. and also where it is keys.alt and keys.controlkey u can choose ur keys like for ur cordination u used alt +Z so u can put is keys.alt+keys.z.

and then

End IF


Sorry for a weird explanation hope u understood and for some reason on my comp this wouldn;t work but it did work on my friends comp so i tried using my first example and tat one worked so i thought that would maybe workk for all


Happy now?

lol

Good Luck with ur app

Re: how to add hotkeys to ur app

Posted: Sun Nov 29, 2009 9:07 pm
by NoWayIn
What you said in your first post is different from what you just told me.

What I do is just do KeyPreview = True in form_load then use the e.KeyCode command

Re: how to add hotkeys to ur app

Posted: Sun Nov 29, 2009 9:10 pm
by NoWayIn
Just a quick tip

when you use e.Keycode = Keys.keys

it won't work if your form is not focus

Meaning if you Minimize it and click on another application, the hotkeys won't work :P

the way I that I use hotkey it work even though your form is NOT focus

Re: how to add hotkeys to ur app

Posted: Tue Dec 01, 2009 2:58 am
by Robby
o ok

Re: how to add hotkeys to ur app

Posted: Tue Dec 01, 2009 4:29 am
by NoWayIn
so yeah Keys.key is only good if you're using it in the program ( while it's focus )
Otherwise it's no good :D

Re: how to add hotkeys to ur app

Posted: Wed Dec 16, 2009 4:15 am
by Robby
yea can u show me how to do it out of focus as that will be rlly helpful for a program i m trying to code.