根据表单大小调整面板大小 [英] Resize the panel according the size of the form

查看:96
本文介绍了根据表单大小调整面板大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我在WinForm上使用了面板.当我调整表格大小或最大化或最小化表格时,我希望面板相应地调整大小.

我必须修改什么属性?

截图: http://img839.imageshack.us/img839/3157/capturezhy.png [ ^ ]

Hi,

I have used a Panel on my WinForm. When I resize the form, or maximize or minimize the form, I wanted that the Panel should resize accordingly.

What property would I have to modify?

Screenshot: http://img839.imageshack.us/img839/3157/capturezhy.png[^]

推荐答案

您可以为此使用anchor属性.您首先将面板放置在窗体上,然后将锚点启用到左侧,顶部,右侧和底部.然后,面板将相对于表单调整大小.

http://msdn.microsoft.com/zh-cn/library/system.windows.forms.control.anchor%28VS.71%29.aspx [ http://www.tutorialized.com/view/tutorial/C-Resizing-controls-with-form-Anchor-property/52689 [
You can use the anchor property for this. You first place the panel on the form and then enable the anchors to left, top, right and bottom. The panel will then resize relative to the form.

http://msdn.microsoft.com/en-us/library/system.windows.forms.control.anchor%28VS.71%29.aspx[^]

http://www.tutorialized.com/view/tutorial/C-Resizing-controls-with-form-Anchor-property/52689[^]

Good luck!


这篇关于根据表单大小调整面板大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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