Problem with sizing form contents relative to the menu
Basically, i have the menu strip sitting on the chessboard i drew. I don't want this so i try to s开发者_运维百科tretch the board so the board will go down (it has labels that aren't attached to the board/tablelayoutpanel
itself). How can i make the menustrip
above not sit on any object on the form?
P.S. i remember i did it by going to the forms properties, but i forgot how to do it?
Your non-menu, or chessboard part of the UI, should be in some sort of container such as a Panel
. (This will be a top-level container that will contain your Label
s as well as your TableLayoutPanel
.) Set that container's Dock property to Fill in the properties (that's probably the step you're forgetting.)
Also: Docking is highly dependent on the order of object declaration/initialization which is controlled easily by the Move To Front/Send To Back commands in the designer's context menu. To make sure you have the correct order, click on your container object in the designer and select Bring To Front from the context menu to make sure the fill docking happens after the Top docking of the menu.
Just set your form's attribute MainMenuStrip
to your MenuStrip
control and it should appear "docked". If that isn't the issue, a screenshot might be useful as I'm not 100% sure on what your issue is.
精彩评论