如何在flowLayoutPanel中锚定和停靠控件 [英] how to anchor and dock controls in flowLayoutPanel

查看:98
本文介绍了如何在flowLayoutPanel中锚定和停靠控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有几个dataGrid的winForm,这些dataGrid根据用户输入添加到flowLayoutPanel中.
我想在调整表单大小时调整控件的大小.我已经在网上阅读了几篇文章,但仍然无法完成这项工作.
有人可以告诉我这是怎么做的吗?


预先感谢,
-DA

I have a winForm with several dataGrids that are added to a flowLayoutPanel based on user input.
I''d like to have the controls re-size when the form is re-sized. I''ve read a few article on the web but I''m still unable to get this work.
Can someone one please show me how this is done?


Thanks in advance,
-DA

推荐答案

为什么不将常规System.Windows.Forms.Panel与专门为此类产品设计的属性Dock一起使用?您可以嵌套此面板的实例,以获取各种复杂程度的对接.这样的设计在调整窗口大小方面也表现得很好.您可以组合不同类型的面板,包括System.Windows.Forms.FlowLayoutPanel的面板.

请参阅:
http://msdn.microsoft.com/en-us/library/system. windows.forms.panel.aspx [ ^ ],
http://msdn.microsoft.com/en-us/library/system. windows.forms.flowlayoutpanel.aspx [ ^ ],
http://msdn.microsoft.com/en-us/library/system.windows.forms.control.dock.aspx [ ^ ].

—SA
Why not using regular System.Windows.Forms.Panel with the property Dock specially designed for such things? You can nest instances of this panel to obtain docking of any level of complexity. Such designs are very well behave on window resize, too. You can combine panels of different types of panels, including System.Windows.Forms.FlowLayoutPanel.

Please see:
http://msdn.microsoft.com/en-us/library/system.windows.forms.panel.aspx[^],
http://msdn.microsoft.com/en-us/library/system.windows.forms.flowlayoutpanel.aspx[^],
http://msdn.microsoft.com/en-us/library/system.windows.forms.control.dock.aspx[^].

—SA


这篇关于如何在flowLayoutPanel中锚定和停靠控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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