维持在表格的大小和控制的位置表格、大小、位置

2023-09-06 14:30:28 作者:清眉婉目

我想保持规模和控制相对于其容器,例如,规模和形式的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.

 
精彩推荐
图片推荐