Hide main menu

Malfunction

Junior Contributor
Joined
Dec 8, 2003
Messages
203
Location
Berlin, Germany
Hi there......

I have a menufunction that switches my app to fullscreen mode.* The user can edit a sheet (panel) and preview it in that mode. The panel gets resized to fullscreen and everything else hase to disappear.
I use
this.FormBorderStyle = FormBorderStyle.None;
this.WindowState = FormWindowState.Maximized;
to maximize my app and
toolBar1.Visible = false; to hide the toolbar but how can I hide the mainmenu?

It has no visible property and this.menu = void or null doesn't work either.

Any ideas?

tHx



* Just like Powerpoint where you can edit a page and preview it in fullscreen.
 
Why not just set all the top menuitems visible property to false

me.MenuItem1.visible = false

and when you want to display it again

me.MenuItem1.visible = true
 
Last edited:
angus234 said:
after hiding the Menu, How to make the menu appears again?

this.Menu = new Menu(); <- it doesn't work

Thank you.

You're creating a whole new menu without any menuitems. Somewhere in your form you (or the designer) declared a variable probably called mainMenu1 that holds a reference to the menu.
this.Menu = null removes the menu from the form but the reference is still kept by the variable mainMenu1.
So this.Menu = thismainMenu1; should work.
 
Back
Top