如何在Winforms中调整窗体大小时自动水平对齐更多标签 [英] How do I Auto Align more labels horizontally when form is resized in Winforms

查看:101
本文介绍了如何在Winforms中调整窗体大小时自动水平对齐更多标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我连续有5个标签。当我使用c#最大化表格时,我需要在行中自动对齐5个标签。

我已经通过Anchor属性但它每行只对齐3个标签。 br />


如果有人知道怎么办,请帮助我。



提前致谢

Hi,

I have 5 labels in a row. I need to auto align 5 labels in row when t
he form is maximized using c#.
I have gone through Anchor property but it aligns only 3 labels per row.

Kindly help me if anyone knows how to handle this.

Thanks in advance

推荐答案

Quote:

使用Dock属性定义控件如何自动调整为其父控件调整大小。例如,将Dock设置为DockStyle.Left会导致控件将其自身与其父控件的左边缘对齐,并在调整父控件的大小时调整大小。控件停靠在它们的Z顺序中,这是沿着窗体的Z轴(深度)对窗体上的控件进行可视化分层。

控件可以停靠在其父容器的一个边缘或可以停靠到所有边缘并填充父容器。

Use the Dock property to define how a control is automatically resized as its parent control is resized. For example, setting Dock to DockStyle.Left causes the control to align itself with the left edges of its parent control and to resize as the parent control is resized. Controls are docked in their Z-order, which is the visual layering of controls on a form along the form's Z-axis (depth).
A control can be docked to one edge of its parent container or can be docked to all edges and fill the parent container.





http://msdn.microsoft.com/en-us/library/system.windows.forms.control.dock(v = vs.110).aspx [ ^ ]


这篇关于如何在Winforms中调整窗体大小时自动水平对齐更多标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆