简体   繁体   中英

Resizing a panel c# win forms

If you imagine a win form with a line drawn vertically down the middle. On the left i have a graph, and when you click the graph certain forms open on the right in an mdi type panel.

I am trying to figure out how to logically get this to look like a proper application should but am failing!

The whole form loads in a maximised view. I first set the panel width to 0 then when i add a form i check if the panels width is less than the forms, if it is then change the panels width to that of the forms.

This doesn't look great tho tbh, resizing makes strange things happen and i see a lot of grey. Does anyone have any ideas?

Use a SplitContainer on your main form. Ensure it's Dock property is set to Fill

Put your graph stuff on the left panel, and your other stuff on the right side.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM