473,659 Members | 2,640 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 ?

cancelReference PointsToolStrip MenuItem.Shortc utKeys = Keys.Escape;

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

Keys.Escape alone isn't a valid shortcut:

"ToolStripManag er.IsValidShort cut 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******@mestd agh.bizwrote in message
news:O0******** ******@TK2MSFTN GP03.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 ?

cancelReference PointsToolStrip MenuItem.Shortc utKeys = 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
2557
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 can tell there is no way to add a short cut that is not in the Shortcut enum. I have my on keyboard hook so I am not worried about the custom shortcut magically working. I just want it to appear nicely formated on the menu. Anyone have any...
4
8843
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 a form that I would like a shortcut menu on 1 control and no shortcut on any other control in the form. But the controls that have no shortcut display a default shortcut. Access help states " If you set the ShortcutMenuBar property to a value
2
3791
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 directions. i tried both but for some reason i cannot delete the categories called "filter", "form", etc. eventually i would like to add commands to the "custom" category, ie commands "filter by form, "filter for:" and "filter by excluding" options and...
5
5173
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 have the "Shortcut Menu Bar:" set to (default) The "Shortcut Menu Bar" property of the text boxes, is empty. So, where is my cut, copy, and past????? Thanks....
2
1709
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
23969
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
4468
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 making it a shortcut menu. I have no problem linking it to the list control. The menu comes up when I right-click the list control.
3
8973
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 ContextMenuStrip. So I use that code: private void pasteToolStripMenuItem_Click(object sender, EventArgs e)
0
1183
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 but for some reason can not assign a shortcut key to my item because it doesn't show up like all of the original menu items under My question is, any idea why my menu item shows up in the context menu but not under ?
2
2062
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: =Forms!.showAvailability() showAvailability is a public function in the module of the form OrderDetails. This follows the working pattern for all other forms. When I right click the item in the shortcut menu, I get the error:
0
8428
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
8851
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
8751
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
8535
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
8629
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
7360
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5650
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
4176
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
4338
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.