C# Windows Form Menu Problem

I'm using C# Windows Form Menu control, and I have added short cuts using the "&" symbol, and the short cuts show at design time (as underlined letters) but they don't show at run time.  What am I doing wrong?
tsmolskowAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

nayernaguibCommented:
Nothing wrong! Shortcut keys get underlined when you press the Alt key. Afterall, this is how you can use the shortcut keys. :-)

_______________

  Nayer Naguib
0
tsmolskowAuthor Commented:
Hey Nayer, I just tried that but no luck, they don't show up and the don't function (for example, pressing Alt+F does not open the file menu).
0
nayernaguibCommented:
If the Text property is "&File" (as an example), then when you press the Alt key, the F letter will get underlined. Next, when you press F (while holding down the Alt key), the menu gets opened.

_______________

  Nayer Naguib
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

tsmolskowAuthor Commented:
Right, that is how I have it, and that is how it is suppose to work, but it's not working.
0
nayernaguibCommented:
As far as I know, you can do *nothing* to disable this feature! Even when the menu item is disabled, the Alt+Key combination selects the menu item!

Try to do this: place the following line of code in the Form Load event handler. It should put the shortcut character of the specified menu item in the titlebar of the form.

      Text=myMenu.MenuItems[someIndex].Mnemonic.ToString();

Replace myMenu with the name of your menu, and someIndex with any valid item index.

Another thing to check: Try to press Alt+F (or any other combination) while using any Windows application (such as Internet Explorer), and Make sure that some letter is underlined.

_______________

  Nayer Naguib
0
tsmolskowAuthor Commented:
like this (?):

Text= menuFile.MenuItems[1].Mnemonic.ToString();
0
nayernaguibCommented:
Are you using multiple MenuItem controls on the same form?
You should use only one control, and use it add *all* required menus and submenus.

You cannot have menuFile, menuEdit, menuView, etc...
You should have one control (for example, mainMenu). You can use mainMenu.MenuItems[index1] to access main menu items (such as File, Edit, etc...), and mainMenu.MenuItems[index1].MenuItems[index2] to access submenus (such as New, Open, Save submenus of the File menu).

If that is your problem, create a new empty project, and try using only one MainMenu control. Trying to modify your current project by removing additional MainMenu controls will possibly not work.

_______________

  Nayer Naguib
0
tsmolskowAuthor Commented:
Hey Nayer, Well I'm just using the MS MainMenu control, not any of the others, but I'm also using some third party components, but they don't have a menu component, just a tool bar component.  I'll try a whole new project without the components, and LYK.  Thanks for hanging in there, I really need to solve this mystery.  BTW, this project has to be in 1.1, I know 2.0 is an improvement, but I can't use that right now.
0
tsmolskowAuthor Commented:
Well, the test project performs as you described, so it's possibly related to the components - at least that's my best guess, your thoughts?
0
nayernaguibCommented:
I was not talking about using other types of controls, but rather about having multiple MainMenu controls on one form. This does not work.
If that is what you were doing, then most probably this is your problem.

_______________

  Nayer Naguib
0
tsmolskowAuthor Commented:
No, I double checked through the designer and code editor, I have only one MainMenu control
0
nayernaguibCommented:
Maybe adding the third party toolbar component has some similar effect to adding other MainMenu controls!

_______________

  Nayer Naguib
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
tsmolskowAuthor Commented:
That's my thought - I will check with the vendor to see if there is a trouble ticket work around...
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Programming

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.