Solved

How do you set a menu item's shortcut key at run time?

Posted on 2001-06-06
9
176 Views
Last Modified: 2010-05-02
According to MS documentation the shortcut property is not available at run time.  Is there any way to set a menu item's shortcut key at run time that is not documented?
0
Comment
Question by:eluper
  • 3
  • 2
  • 2
  • +2
9 Comments
 
LVL 2

Expert Comment

by:Microsoft
Comment Utility
go to properties

type &f

eg

&file would give you a short cut key of F with a bar below it to indicate that its a short cut key and it would also make the word

file with a bar under the F

this should answer your undocumented question

0
 
LVL 6

Expert Comment

by:JonFish85
Comment Utility
I believe that eluper wants a shortcut key like Ctrl+S and such. Am I correct?
0
 
LVL 8

Expert Comment

by:glass_cookie
Comment Utility
Hi!

Here's just a suggestion.  Make your shortcut keys something like "Alt+Y" RATHER then "Ctrl+Y" for example.  From there, you could use a command button, make it's caption "&Y", top=-1000, Tabstop = False.

Hee's the code to set the caption to Alt+[Whatever]:

MyMenu.Caption = "Unload"
MyMenu: MyMenu.Caption = MyMenu.Caption + Chr$(9) + "Alt+X"
'Remember also to change to command button's caption after setting shortcut:
MyCommandButton.Caption  = "&X"

The above code would set the menu, MyMenu, to something like:

----------------------
  Unload   Alt+X
----------------------

That's it!

glass cookie : )
0
 

Author Comment

by:eluper
Comment Utility
JonFish85,
You are correct. I am looking for Ctrl+S, etc...

glass cookie,
Thanks for the suggestion but i really would like to use the (ctrl+) style
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 2

Expert Comment

by:Microsoft
Comment Utility
Hey John,

go search the questions list ive submitted points for you 25pnts.

you havent collected them yet.

subject title = POINTS FOR JONFISH95

cheers
Andy
0
 
LVL 15

Accepted Solution

by:
ameba earned 200 total points
Comment Utility
0
 

Author Comment

by:eluper
Comment Utility
Thanks for the link.  It was funny that the linked message progressed in the same manner as this one.

Eric
0
 

Author Comment

by:eluper
Comment Utility
Thanks for the link.  It was funny that the linked message progressed in the same manner as this one.

Eric
0
 
LVL 15

Expert Comment

by:ameba
Comment Utility
Thank you for the points!

Bruno
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now