473,507 Members | 6,459 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to set a shortcut key on a menu item

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 test if there was no
exception). Are there limitations or do I do something wrong here ?

cancelReferencePointsToolStripMenuItem.ShortcutKey s = Keys.Escape;

--
rgds, Wilfried [MapPoint MVP]
http://www.mestdagh.biz
Nov 29 '06 #1
2 6414
Hi Wilfried,

Keys.Escape alone isn't a valid shortcut:

"ToolStripManager.IsValidShortcut Method"
http://msdn2.microsoft.com/en-us/lib...dshortcut.aspx

I don't recommend using it anyway because Ctrl+Escape and Alt+Escape seem to
have specific meaning in Windows already. You should use something like
Ctrl+E instead.

--
Dave Sexton

"Wilfried Mestdagh" <wi******@mestdagh.bizwrote in message
news:O0**************@TK2MSFTNGP03.phx.gbl...
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 test if there was no
exception). Are there limitations or do I do something wrong here ?

cancelReferencePointsToolStripMenuItem.ShortcutKey s = Keys.Escape;

--
rgds, Wilfried [MapPoint MVP]
http://www.mestdagh.biz

Nov 30 '06 #2
Hi Dave,

Thank you. It was for a temporary setting and get it fast disabled by
pressing Esc. But you are right the key itself already has a meaning. I
capture it now in the form's keydown.

--
rgds, Wilfried [MapPoint MVP]
http://www.mestdagh.biz
Nov 30 '06 #3

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

Similar topics

10
2535
by: Lex | last post by:
I am writing a C# app that has a Menu. Some of the menu items will have short cuts that do not exist in the Shortcut enum. I would like the custom shortcuts to appear on the menu but as far as I...
4
8831
by: Salad | last post by:
A97. If you set a forms properties to ShortcutMenu = No, the entire form is disabled from displaying a shortcut menu. If you set the property to Yes, all controls have a shortcut menu. I have...
2
3787
by: JMCN | last post by:
hi i'm having a problem with the customize a shortcut menu. i read the ms office assistance: customize a shortcut menu/delete a command or add to a shortcut menu and followed the simple...
5
5163
by: Steven | last post by:
I have some text boxes on a form in MS Access 2000. When I right click in them I don't get any shortcut menu at all. I want the normal cut, copy, and past menu to come up. In the "Startup", I...
2
1703
by: newbie_csharp | last post by:
Hi, is there anyway to set AltN in shortcut property? thanks *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it!
3
23949
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^_^
1
4442
by: stinehelferw | last post by:
I need a right-click menu on a form list control with combobox controls. I used View->Toolbars->Customize to create a toolbar. I added ComboBox through commands tab. I set properties to Popup...
3
8960
by: ommail | last post by:
I have two RichTextBox controls on a form, and single ContextMenuStrip control which serves for both textboxes. I need to determine which RichTextBox control invokes an event handler in...
0
1178
by: Kevin S Gallagher | last post by:
I found Smart Paster (excellent add-in) VS2005 IDE Add-in under http://msdn.microsoft.com/msdnmag/issues/05/12/VisualStudioAddins/default.aspx#S3 Decided to add my own menu item which works fine...
2
2042
by: Jim Devenish | last post by:
I have set up shortcut menus on many form successfully. However, for the first time, I am trying to set one up on a subform. In the 'On Action:' when customising the menu item I have:...
0
7223
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
7110
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
7314
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
7372
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...
1
7030
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
7482
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...
0
4702
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...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1540
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 ...

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.