简体   繁体   English

C#:谁能给我一个很好的例子,说明如何在运行时锚定控件?

[英]C#: Could anyone give me good example on how anchoring controls at runtime is done?

C#:谁能给我一个很好的例子,说明如何在运行时锚定控件?

        textBox1.Multiline = true;
        textBox1.Anchor = AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Bottom;

Then resize your form and the textbox should grow and shrink while maintaining the same distance from the form edges 然后调整表格大小,文本框应在缩小和缩小的同时与表格边缘保持相同的距离

您还可以看到这篇文章,以查看带有Flags属性的枚举如何工作。

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

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