1

I've got a form with a menu strip that has keyboard shortcut's. Keyboard works as expected. Then I add another form that is owned by the main form (child.Owner = main). When this form has focus I can't access the menu on the main form (using the keyboard).

I guess this is expected behavior, but what if I wanted to allow access to the menu on the main form when the child form have focus, how do I do that?

I don't feel like manually set up and handle all keyboard events and bind them to the correct action, is this the only way?

Cheers, Eq

eq_
  • 109
  • 6

2 Answers2

0

set property KeyPerview of child form True.

MRM
  • 435
  • 2
  • 10
  • That didn't work, should it really? I though that was used by a form to get input before any child controls. – eq_ Dec 12 '11 at 14:30
0

You can try out the following - it will add the menu to the child form, but still run the event handlers in the parent form:

        Form2 childForm = new Form2();
        childForm.Controls.Add(menuStrip1);
        childForm.MainMenuStrip = this.menuStrip1;
        childForm.Show();
Veldmuis
  • 4,678
  • 4
  • 25
  • 25