Shortcuts with ContextMenu and toolbar

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a MDI windows forms application that uses a toolbar on the parent
form. I've also setup a context menu on this form to be used as the dropdown
menu for one of the toolbar buttons. However, the shortcut keys for the
context menu do not seem to work for the menus, only clicking on them. Is it
possible to use shortcuts this way, or will shortcuts only work with a
MainMenu? Thanks in advance, Ben
 
Shortcut-keys normally work for context menus as well. How are you creating
the context menu?

Regards, Jakob.
 
Jakob,

Thanks for the response. I created the context menu through the form
designer, and also assigned the keyboard shortcuts at that time. My guess is
that this has something to do with using an MDI app, and the Main form isn't
"seeing" when the shortcut is pressed. Any ideas? I'm going to try and create
a sample app to see if I can reproduce the exact problem. Thanks again, Ben
 
Ben,

I tried creating a toolbar with a context menu for the main form of an MDI
application and your are right - shortcuts do not work. I found a simple
workaround though. It's not very elegant but it works. If you create a
hidden main menu for the form which has the same event handlers and the same
shortcuts as the context menu, then it works fine.

HTH, Jakob.
 
Back
Top