1
votes

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

2
No this is not an MDI applicationeq_
Then you need manually send keyboard events to parent form.Renatas M.

2 Answers

0
votes

set property KeyPerview of child form True.

0
votes

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();