How to have MainMenu be parent of Control object

V

Valerie Hough

I would like to have a control I have created have a
System.Window.Forms.MainMenu as its parent. The menu will always have lots
of available space on the right side and I want to take advantage of this.

I tried to using the SetParent API but my control is not visible, even
though it seems to be in the right place. I also tried using
MyControl.BringToFront() in case this is a zOrder issue.

I see that in PowerPoint there are maximize/minimize buttons appear in the
exact place that I want my control, so it must be possible.

Thanks in advance,
Valerie Hough
 
S

Stoitcho Goutsev \(100\) [C# MVP]

Hi Valerie,

MainMenu component in .NET represent the standard windows menu strip. Its
not a contro it has no parent or whatsoever. Windows OS allows only top
level windows to have main menu strip. Child windows cannot. Speeking in
terms of Windows forms only top-level forms can have main menu.

If you want menu on control different than form you should go with third
party one that implments the main menu strip as a control.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top