Using MenuStrip

G

Gav

I am using a MenuStrip on a form and adding a Panel to the same form in the
program. When the Panel is added the top of the Panel is behind the
MenuStrip, so the top of the Panel is hidden. How do I make the Panel I have
added appear below the MenuStrip? Is it something to do with the MenuStrip,
is it floating?

Gav
 
M

Marc Gravell

Try right-clicking on the Panel in the designer and choosing "Bring to
Front". When using docked controls (which I assume this is), the order
of the Controls is very important. The above changes the order,
allowing the Panel to know about (and therefore allow for) the
MenuStrip at the top of the page.

If it isn't docked - just move it.

Marc
 
G

Gav

Marc Gravell said:
Try right-clicking on the Panel in the designer and choosing "Bring to
Front". When using docked controls (which I assume this is), the order of
the Controls is very important. The above changes the order, allowing the
Panel to know about (and therefore allow for) the MenuStrip at the top of
the page.

If it isn't docked - just move it.

Marc

I've not added the Panel in the Designer it is added at runtime. The
MenuStrip is the only component visable in the designer.

Gav
 
M

Marc Gravell

So call newPanel.BringToFront() or mainMenu.SendToBack() after you've
added the newPanel to the Controls collection.

Same reasons.

Marc
 
M

Marc Gravell

For info, another common solution here is to add a panel at
design-time to represent the remaining client area, and then any
runtime controls are added to this container panel. This way, your
runtime code doesn't need to care about any header / footer /
side-pane information - it just knows that it can do what it likes
inside the panel it has been allocated.

Marc
 
G

Gav

Marc Gravell said:
For info, another common solution here is to add a panel at design-time to
represent the remaining client area, and then any runtime controls are
added to this container panel. This way, your runtime code doesn't need to
care about any header / footer / side-pane information - it just knows
that it can do what it likes inside the panel it has been allocated.

Marc

Oke doke. Thanks. :blush:)
 

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