自动调整WinForm中控件的大小 [英] Auto size the controls in winform

查看:68
本文介绍了自动调整WinForm中控件的大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个winform,并在该表单中放置了一个列表框.当我最大化winform时,列表框的大小保持不变.

I've a winform and I placed a listbox in that form. When I maximize the winform the size of the list box remains same.

但是我不想这样.我想自动调整大小.

But I dont want like this. I want to adjust the size automatically.

这是否有任何默认属性?

Is there any default property for this?

谢谢你,那古(Nagu)

Thank you, Nagu

推荐答案

查找锚点属性.您可以将锚点设置为根据表单自动调整大小.

Look for the anchor properties. You can set the anchor to resize automatically following the form.

锚点有4个面.如果锚定到所有4个面,则控件将根据其父窗体的大小保留其大小比例.

The anchor has 4 sides. If you anchor to all 4 sides, the control will retain its size ratio according to the size of its parent form.

这篇关于自动调整WinForm中控件的大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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