简体   繁体   English

在Windows中垂直固定控件以正确调整大小

[英]Anchoring controls in windows forms vertically to resize properly

I'm trying arrange controls in a WinForms application so that they resize properly when the form size is changed. 我正在尝试在WinForms应用程序中排列控件,以便在更改窗体大小时可以正确调整它们的大小。 Every time I try to resize the form the second label gets overlapped. 每次尝试调整表单大小时,第二个标签都会重叠。 Obviously I'm not getting the trick here. 显然,我在这里没有窍门。 Can anyone please advice on how to set anchoring in a layout like mine. 任何人都可以提出有关如何在我的布局中设置锚点的建议。

窗口布局

you can solve this by anchoring, but it won't look nice ... if you use only anchors, then you'll have to decide for one of those big text boxes to resize with the window ... 您可以通过锚定来解决此问题,但效果看起来并不好...如果仅使用锚定,则必须决定使用那些大文本框之一来调整窗口大小...

try out the TableLayoutPanel . 试用TableLayoutPanel

it's a standard control shipped with the framework, and it will most likely solve your problem AND look nice in the end ... 这是框架附带的标准控件,它很可能会解决您的问题并最终看起来不错。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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