Solved

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

Posted on 2001-06-06
9
178 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
ID: 6160386
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
ID: 6160459
I believe that eluper wants a shortcut key like Ctrl+S and such. Am I correct?
0
 
LVL 8

Expert Comment

by:glass_cookie
ID: 6160535
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
ID: 6160589
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 2

Expert Comment

by:Microsoft
ID: 6160834
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
ID: 6161877
0
 

Author Comment

by:eluper
ID: 6163707
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
ID: 6163713
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
ID: 6163933
Thank you for the points!

Bruno
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

895 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

13 Experts available now in Live!

Get 1:1 Help Now