Click here to Skip to main content
15,886,578 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hey Guys

How do I create own shortcuts in VB6?
Example: I want to give out this text "Hello World!" whenever I press Ctrl+T.

Regards
v_tigra
Posted
Updated 1-May-14 1:09am
v2
Comments
[no name] 1-May-14 7:55am    
What have you tried? What is the problem with the code that you have tried? You know VB6 is long dead right?
v_tigra 2-May-14 5:28am    
Yes, I know it's "dead", but we still work with VB6 only on one important project.
I've tried with a normal form, it worked - but it seems that MDIforms don't have such an event like "KeyDown(..)" or "KeyPress(..)".

Check this out: create-a-hot-key[^]
 
Share this answer
 
On key press event you can write following code

VB
if keycode = vbkeyf4 then
cmdcompute_click()
End if


Also read this post

http://visualbasicnetcode.blogspot.in/2010/05/how-to-create-hot-key-in-visual-basic-6.html[^]
 
Share this answer
 
Comments
v_tigra 2-May-14 5:33am    
Yes, but KeyPress only works for "normal" forms, not MDIForms.. is there an other possibility to work with something else like "KeyPress" or "KeyDown"?

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