473,672 Members | 2,414 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

hotkey

hi, i was wondering how i can create hotkeys for my form? like if it involves
a select case for the keydown event ro what so if anyone could help with
this, thatd b great
--
-iwdu15
Nov 21 '05 #1
2 1394
Set the Forms "KeyPreview " property to True then in the Forms "KeyPress"
event, you can get access to the keys before the controls do and intercept by
setting the KeyEventArgs "Handled" property to True.
--
Dennis in Houston
"iwdu15" wrote:
hi, i was wondering how i can create hotkeys for my form? like if it involves
a select case for the keydown event ro what so if anyone could help with
this, thatd b great
--
-iwdu15

Nov 21 '05 #2
"iwdu15" <iw****@discuss ions.microsoft. com> schrieb:
hi, i was wondering how i can create hotkeys for my form? like if it
involves
a select case for the keydown event


The solution depends on what you consider to be a hotkey.

You can assign keyboard accelerators to various Windows Forms controly by
preceeding a character of their captions (property 'Text') with the "&"
character. If "&Start" is assigned to a button's caption, the user can
press Alt+S to raise the button's 'Click' event.

Another method to provide keyboard accelerators is using a menu bar
(MainMenu component). Each menu item has a 'Shortcut' property. If the
shortcut gets pressed, the according menu item's 'Click' event handler is
invoked. When using this approach the menu items do not even need to be
visible in order to make the shortcuts work.

The third alternative is to set the form's 'KeyPreview' property to 'True'
and handle the form's 'KeyDown'/'KeyUp' events.

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

Nov 21 '05 #3

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

Similar topics

1
1903
by: Nitesh Jain | last post by:
I want to write a simple utility, so that if I select a text, and press a hot key say (CTRL+ALT+G), then I should be able to open a google search page with the selected text. Could someone tell me how to get the selected text when this hotkey is pressed.
0
1440
by: kurotsuke | last post by:
Can anybody tell me where I can find a sample C# forms that implements the hotkey selection like in babylon so that the user can actually press the hotkey combination instead of selecting the keys on a listbox? Thanks.
5
3135
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 application. On the Options form I have a textbox that the user can use to enter the key he would like to use as the hotkey. I want to allow the hotkey to be letters, numbers and the control keys. When the textbox has focus and the user selects a letter...
3
2594
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 non-threaded version that works 2) a threaded version that doesnt work. Any constructive suggestions would be helpful
2
8301
by: Marc Gravell | last post by:
Just a thought prompted by the chain "Splitting up a string"; ages ago a wrote (in VB via Windows API dll calls) a global hotkey app that runs silently, intercepts ++V, converts the clipboard to a string and sends +; I still use it almost constantly, but it is a pain to maintain. I couldn't find any native C# support for global hotkey (CLR2.0) - any idea if this could be re-written in C# without any dll imports in my code? Marc
0
1800
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 program(it would minimize to tray before you call it), I found it doesn't work. Finally I found the statement which cause it: this.ShowInTaskbar = false; Though I wrote "ShowInTaskbar = true" later in the program, but hotkey didn't work...
1
5949
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 app is bound to use the same thing, causing end user frustration. So I want the end user to be able to specify the hot key to use for task X in the configuration window. Now receiving and handling the hotkey is no problem. I do that easily...
0
1909
by: john | last post by:
Is there a hotkey to run a query which is in design mode? And a hotkey to go from form-run-mode to form-design-mode? Thanks, john
3
2526
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
18
44621
by: AdamOnAccess | last post by:
Anyone know an easy way to toggle between Form and Design view with a hotkey? I know you can switch from Design view to Form view with hotkey F5. But is there a hotkey to switch back (from Form view to Design)? Shift-F5 is not it. I've searched Google and I can't believe I couldn't find an answer. Please help. Adam
0
8498
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8418
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8840
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8628
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
4237
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4433
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2830
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2083
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1831
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.