维持在表格的大小和控制的位置 [英] Maintaining the size and position of the Control in the form

查看:106
本文介绍了维持在表格的大小和控制的位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想保持规模和控制相对于其容器,例如,规模和形式的RichTextBox的位置,位置应保持在窗体调整大小。

I want to maintain size and position of the control relative to its container eg,size and position of the richtextbox in the form should be maintained when form resize.

推荐答案

如果你有更复杂的设计,只是一个锚和对接是远远不够的。想象一下,你有两个文本框,并同时调整你喜欢这两个箱子增大和缩小(由50%各一个)。在这种情况下,你可以使用TableLayoutPanel中具有相对大小及这些面板中你有固定的对接安排你的控制。

If you have more complex designs, just a anchor and docking is not enough. Imagine you have two textboxes and while resizing you like that both boxes grow and shrink (by 50% for each one). In that case you can use the TableLayoutPanel with relative sizes and within these panels you arrange your controls with anchoring and docking.

另一个有用的东西:在一个更复杂的设计,你应该看看到视图 - 其他窗口 - 文档大纲,当你在设计视图,你会得到什么地方该控件驻留一个很好的概述

Another helpful thing: In a more complex design you should take a look into View - Other windows - Document Outline, while you're in Design View and you get a great overview about where which control resides.

这篇关于维持在表格的大小和控制的位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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