473,386 Members | 1,795 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,386 software developers and data experts.

Assign a hotkey to button control

I would like a assign a Function key (F8, for example) to invoke a button
control click
Please help!

Thanks

Bill
Jun 22 '07 #1
3 14109
"Bill Nguyen" <bi*****************@jaco.comschrieb
I would like a assign a Function key (F8, for example) to invoke a
button control click
Please help!

Set the Form's keypreview property to true. In the Form's KeyDown event,
catch the key and call the same procedure as you call in the button's click
event. Or, if the Form has a Menu, add the function as a menu item and
assign F8 as the shortcut. In the click event, invoke the code.
Armin

Jun 22 '07 #2
"Armin Zingler" <az*******@freenet.deschrieb:
>I would like a assign a Function key (F8, for example) to invoke a
button control click

Set the Form's keypreview property to true. In the Form's KeyDown event,
catch the key and call the same procedure as you call in the button's
click
event. Or, if the Form has a Menu, add the function as a menu item and
assign F8 as the shortcut. In the click event, invoke the code.
Note that if you are using the standard menu control (not the toolstrip) the
menu item doesn't even need to be visible in order to make the shortcut
work.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Jun 22 '07 #3
Standard practice is to use & in button text(caption) before some letter.
Then Alt-<letterworks as hot key without any further ado

HTH

"Bill Nguyen" <bi*****************@jaco.comwrote in message
news:OD***************@TK2MSFTNGP06.phx.gbl...
>I would like a assign a Function key (F8, for example) to invoke a button
control click
Please help!

Thanks

Bill


Jun 22 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: zhimin | last post by:
I want to register some hotkey for my form: If user press Ctrl + Enter, the result is equals to the OK button clicked If user press F2, the textbox txtNumber focused and so on I had read the...
0
by: Gman997 | last post by:
Hi all, Here is my dilemma which I bet others have faced. I have a datagrid written in C# which based upon user criteria will display anywhere from 6 to 18 columns of numbers which will be...
4
by: hb | last post by:
Hi, When I add an asp:button (ex: id=btnLog) on home.aspx, I need to create btnLog_Click() event in home.aspx.cs, and also link this event and the button in OnInit() method by adding:...
5
by: jcrouse | last post by:
I have an application thats a viewer. I also have a form that is fired from a Tools/Options menu selection. In the Options form the user can select a hotkey to use to exit the main viewer...
1
by: Marc | last post by:
Hi! I'm working with a C# client that calls a php web service. I've created a wrapper to call the service using .NET wsdl tool (adding a web reference). The call to the server works fine, it...
3
by: Rsrany | last post by:
I've been working on a few gtk applications and need to tie a hot key catcher into a thread. I am currently finding threaded user32.GetMessageA do not work. I have included two programs: 1) a...
0
by: yasker | last post by:
I register a hotkey following this article: http://www.dotnet2themax.com/ShowContent.aspx?ID=103cca7a-0323-47eb-b210-c2bb7075ba78 Using windows api to archive it. But when I use it as a part of my...
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...
3
by: =?Utf-8?B?QmlsbHkgWmhhbmc=?= | last post by:
I want to have following hotkey used in asp.net application, how to do this especially for F5? ESC F3 F4 F5 F6 F9 F10
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...

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.