1

I don't know how to ask so this is the example:

auto-size

So my question is how to avoid two buttons overlapping each other ? How do i need to anchor them or to make the location dinamic ?

In the example both buttons are anchored left,top,right. I need them to auto-size when i maximize.

4

3 回答 3

0

将它们放在左右停靠的面板中。将它们都停靠以填充但首先停靠右侧按钮。

于 2012-11-19T08:18:18.847 回答
0

使用控件的Anchor属性以您应该工作的方式使用,并且是实现所需效果的最简单方法。只需确保您首先在设计器中按照您希望它们的方式调整和定位两个按钮(以便它们在设计器中看起来正确),然后将两个按钮的锚点设置为左顶部。然后,当您调整表单大小时,他们将按比例调整大小和重新定位自己。

或者,您可以将两个按钮放在具有两列的TableLayoutPanel或常规面板上,并使用Dock属性,将一个按钮停靠在左侧,将一个按钮停靠在右侧。

于 2012-11-19T08:18:20.700 回答
0

好吧,如果您希望它们每个都具有相同的大小,请尝试将它们放入一个表格中,以便表格的每一列都是 50% 的宽度。然后将表格设置为左、右和上锚定。

于 2012-11-19T08:19:35.743 回答