how to add hotkeys to ur app
Use this board to post your code snippets - tips and tricks
10 posts
Page 1 of 1
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;)
lol that is how ot add hotkeys instead of writing the keypreview codE 

I didn't get it at all, rewrite it when you're on your computer please.
and I like the KeyPreview, it's easy
and I like the KeyPreview, it's easy
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
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
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
What I do is just do KeyPreview = True in form_load then use the e.KeyCode command
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
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
o ok
so yeah Keys.key is only good if you're using it in the program ( while it's focus )
Otherwise it's no good
Otherwise it's no good

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.
10 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023