.NET WinForms 锚点属性
我有一个表格,里面有一个面板。我已经设置了面板锚点,效果很好,当我调整表单大小时,面板高度会增加。
问题是:我在面板中有几个组框,当面板的高度增加时,组框的垂直间距应该相等地增加。
我怎样才能做到这一点?
I have a form that has a panel in it. I've set the panel anchor and it works great, when I resize the form the panels height is increased.
The problem is: I've got several group boxes in the panel, and when the panel's height is increased, the group box vertical spacing should be increased equally.
How can I do that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用 TableLayoutPanel 并确保其中的行全部设置为“AutoSize”的大小模式。接下来,确保放置在表格中的框的“Dock”属性设置为填充模式之一。
Use a TableLayoutPanel and make sure the rows in it are all set to a size mode of "AutoSize". Next, make sure that your boxes you place in the table have a the "Dock" property set to one of the fill modes.
我很久以前就看到这个问题了。我正在谈论的表单最终有一个不同的界面,但我最近做了一些非常相似的事情,我是这样做的:
I've just seen this question from a long time ago. The form I was talking about end up with a different interface, but I've recently done something very similar and I did it like this: