简体   繁体   中英

How to use Visual Studio's C# Windows Forms Design View for a Scalable/Resizable Window?

I am attempting to create a Windows Forms Application that will have components that scale when the window is being resized. I am running into issues with the Form when attempting to resize it when the application is running. First of all, this is what it looks like in the editor at its Minimum Size: 在设计视图中

Then I stretch it out at run time and it is even on both sides (after tinkering with the Fixed-Splitter position: 更宽的

I run into more problems when attempting to put List Boxes in the blue and red panels. In design: 带列表框

Stretched: 带列表框

I want the list boxes to nicely fill most of the width of each side, but when I attempt to use the Anchor tags it gets messed up.

So to sum up: Why is the designer all asymmetrical compared to the finished product and how do I make the List Boxes fit and scale in width when the window is resized?

I am using VS17 if that helps! Thanks!

The anchors was always (I don't know why) littlebit broken. Use the composition of nested Panel s and use the Dock and Padding properties instead of anchros.

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