本文介绍了我怎样才能得到的WinForms一个StackPanel中样布局的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了三个按钮的对话框。我把这些按钮在FlowLayoutPanel中使用的FlowDirection设置为自顶向下。

I created a dialog with three buttons.I put those buttons in a FlowLayoutPanel with FlowDirection set to TopDown.

我试图大小的按钮在面板的宽度,然后设置锚点为左+前+右。这似乎已经在FlowLayoutPanel中没有任何影响。

I attempted to Size the buttons to the width of the panel and then set the Anchor to Left+Top+Right. This seems to have no effect in a FlowLayoutPanel.

有一个简单的解决办法?我知道我可以使用FlowLayoutPanel的的onResize受到事件,并转到这个方向,但希望的是设计时设置。

Is there a simple solution to this? I know I can use the FlowLayoutPanel's OnResize event, and go that direction, but was hoping for a design-time setting.

推荐答案

您可以使用的TableLayoutPanel ,如果明确的行管理不是太烦人了。

You can use the TableLayoutPanel, if the explicit row management isn't too annoying.

这篇关于我怎样才能得到的WinForms一个StackPanel中样布局的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-03 00:21