WPF:如何在调整网格大小时让网格中的控件自动调整大小? [英] WPF: How can I have controls in a grid automatically resize when the grid is resized?

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

问题描述

我对 WPF 非常陌生:当表单调整大小时,我需要调整网格上的按钮.按钮之间的空间也需要保持不变.有我可以设置的属性吗?我将宽度/高度设置为自动,但这不起作用.

I'm very new to WPF: I need to have buttons on a grid resize as the form is resized. The spaces between the buttons also need to stay constant. Is there some property that I can set? I played around with width/height as auto, but that didn't work.

推荐答案

设置 Margin 按钮的属性.然后按钮之间的空间将被修复.

Set the Margin property of button. then the spaces between the button would be fix.

这篇关于WPF:如何在调整网格大小时让网格中的控件自动调整大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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