473,414 Members | 1,848 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

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

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
2 29085
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
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: The Flyer | last post by:
Hi Sorry for posting this message to so many groups, but I was not sure which group the windows keyboard experts would be reading, so I ventured to post it to all of them. I want to map or...
2
by: Nick | last post by:
In VS 2003 and VS 2005 beta 2 I am trying to write a simple program. It has a datagrid and a textbox along with a menubar. There is a command in the menu bar which is "Run Query" and has the...
3
by: cyshao | last post by:
How to add a shortcut Ctrl+S ? I want to add a new function for user to provide Ctrl+S to save things. How can I do that? Thanks Charles Shao^_^
0
by: TCook | last post by:
Hello All, First, I apologize for posting this to so many newsgroups but I wasn't sure which newsgroup was most appropriate nor which newsgroup would most likely have subscribers that have done...
1
by: Rune Jacobsen | last post by:
Hi all, I have some often-performed tasks in my applications that I want users to be able to specify hotkeys for. However, I don't want to hard code these hotkeys, as sooner or later some other...
8
by: redeagle | last post by:
I'm wondering what the best practice is for creating a WinApp "wizard" that contains 4 or 5 "steps". Options so far are 1) Single WinForm making various controls visible/non visible at the...
2
by: Wilfried Mestdagh | last post by:
Hi, This gives me a runtime error that it is an invalid value. I tryed some other keys with same result. However I tryed some function keys and they work (whell I did not test if it work, I did...
1
by: Emma Middlebrook | last post by:
Hi there, I'm trying to handle some shortcut keys within my application and I can't seem to get the code to work when you are trying to action against a ctrl + other character. I found a post...
2
by: Andrus | last post by:
If focused control is ReadOnly, menu shortcut key is ignored. To reproduce, run code below, press Ctrl+E. Note that message box does not appear. This issue blocks Ctrl+E usage in application....
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.