By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,699 Members | 1,372 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,699 IT Pros & Developers. It's quick & easy.

Need help creating a shortcut key in vb.net using the CTRL key + function keys (F2)

P: n/a
I am having a problem finding information regarding vb.net allowing
you to create shortcut keys for buttons using the CTRL key + function
buttons such as F1, F2 etc.. (Ex: Press CTRL+F1 to activate a click
event on a button). If anyone could help it would be sincerely
appreciated. Thank You!
Nov 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hello,

"Jim S" <js*********@techint-tech.com> schrieb:
I am having a problem finding information regarding vb.net allowing
you to create shortcut keys for buttons using the CTRL key + function
buttons such as F1, F2 etc.. (Ex: Press CTRL+F1 to activate a click
event on a button).


Create a hidden menu item and assign the shortcut to its 'Shortcut'
property. Put the code in the item's 'Click' event handler.

--
Herfried K. Wagner
MVP VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #2

P: n/a
"Jim S" <js*********@techint-tech.com> schrieb
I am having a problem finding information regarding vb.net
allowing you to create shortcut keys for buttons using the CTRL key +
function buttons such as F1, F2 etc.. (Ex: Press CTRL+F1 to activate
a click event on a button). If anyone could help it would be
sincerely appreciated. Thank You!


These accelerator keys can not be used with buttons. You can use "&Start" to
specify Alt+S as the shortcut for the button. What you can do is, either add
a menu to the form and select the accelarator like Ctrl+F1, or, set the
Form's keypreview property to True and catch the Form's KeyDown event (or
overwrite OnKeyDown).
--
Armin

Nov 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.