473,651 Members | 2,580 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

accellerator keys in c# - using ampersand for shortcut

I have an issue with a multi-form app - not MDI. My issue
is that I need to create shortcut keystrokes for all of
the buttons on each form. I would love to use the typical
method of adding an ampersand(&) before the hotkey
character and have .net do the magic for me. What I am
finding is that it works great on the main form, but on
any child forms i show (using ShowDialog() ) it seems
that the keystroke is getting processed by the main
(parent) form and I get an error if the main form doesn't
handle it.

Can anyone let me know how I might use this extremely
convenient functionality on these child dialogs without
writing my own keypress event handlers for each form?

Thanks!
jiminy
Nov 15 '05 #1
0 1386

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

Similar topics

4
3334
by: Maurice Mertens | last post by:
Hi, I'm trying to set shortcut keys for textboxes. But what is the best way to do this in VB.NET. In Access it was very simple, just put an "&" sign in the label that belongs to the textbox. But in VB.NET it looks like you have to program code for the shortcut keys. Like putting this code in the Form_KeyUp: If e.Alt And e.KeyCode = Keys.L Then Me.ActiveControl = Me.TextBox1
2
2143
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 shortcut key of Ctrl + R If I am typing in my textbox and hit Ctrl + R an extra r character will show up in the textbox. I decided to then try this in VS 2005 and the same thing happens. If I include the following, Private Sub...
3
7393
by: BruceR | last post by:
I have posted a similar message and am reposting due to no response. Basically, I need to know why using the ampersand to indicate an access key for a button makes it so that simply entering the key alone selects the button. It should be that the user must press Alt + the access key. Note that this works also, it is just that I need it to NOT select the button if the user enters JUST the access key. My problem is that my application has...
2
29116
by: Jim S | last post by:
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!
7
4157
by: Ronald S. Cook | last post by:
I'm writing a Windows app and want to associate function keys with some of my menu items (e.g. Help (F1)) and buttons. How can I do this, please? Thanks.
2
11744
by: philelpko | last post by:
Morning all, My database is now secure and hosted on the network and appears to be happily running thanks to several (hundred) posts on this site so thanks to everyone for the help. One person unfortunately did some final destructive testing for me which seem to consist of nothing more than hitting random keys on the keyboard. This, to my horror, unfortunately this found a fault. Shortcut keys. I have found a few threads online but...
1
2903
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 http://groups.google.co.uk/group/microsoft.public.dotnet.languages.csharp/browse_thread/thread/a0bfd442d01f715f/27cbc8062c107680?lnk=gst&q=c%23+shortcut+key+ctrl&rnum=3&hl=en#27cbc8062c107680 that appears to help a lot but it doesn't seem to work...
1
1812
by: =?Utf-8?B?Um9iIE11dGNoZWs=?= | last post by:
I have reinstalled Visual Studio 6.0 and service packs and am programming in VB 6.0 on XP machine. Since re-install of Visual Studio any shortcut keys created on menus using the & character fail to work correctly. Only the top menu level shows the highlighted (underlined) key correctly. Pressing the correct letter appears to work, but the proper letter is not underlined. In addition if I identify shortcut keys (CNTRL + D) for an item the...
0
2643
by: thirunavukarasukm | last post by:
Hai... How to Usercontrols with Shortcut Keys... I am creating one windows apllication.. the apllication contain many form.. in one form i am used one usercontrol(parent control)..
0
8795
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8695
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...
0
8576
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5609
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4143
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
4281
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2696
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
1
1906
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1585
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.