Click here to Skip to main content
15,886,873 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

How do I force the underlining (e.g. &File (File)) of the first character in the MainMenu header items? I can do it with MenuStrip using renderer, but the same technique is unfortunately not applicable with the MainMenu.

For those who don't know how to get the legacy control 'MainMenu', you can get it by right-clicking on the toolbox and selecting 'Select Items...' and then searching for 'MainMenu'.

Thanks very much for your help! 8)

What I have tried:

I have tried using the renderer method that I have used in other projects for the MenuStrip; however this does not work with the MainMenu.
Posted
Updated 14-Dec-17 14:49pm
Comments
CHill60 14-Dec-17 10:51am    
Have you tried preceding the character you want underlined with an ampersand & and making sure the items have ShowShortCutKeys = true

1 solution

The MainMenu class is just a container which holds MenuItem objects, those which are meant to display text and, eventually, mnemonics. So, the MainMenu in itself is not meant to display any text.
You can find more on these there:
MainMenu Class[^]
MenuItem Class[^]
MenuItem.Mnemonic Property[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900