简体   繁体   English

WPF:调整网格大小后,如何在网格中自动调整控件大小?

[英]WPF: How can I have controls in a grid automatically resize when the grid is resized?

I'm very new to WPF: I need to have buttons on a grid resize as the form is resized. 我是WPF的新手:在调整表单大小时,我需要在网格上调整按钮的大小。 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. 我将宽度/高度设置为自动,但没有用。

Set the Margin property of button. 设置按钮的Margin属性。 then the spaces between the button would be fix. 那么按钮之间的间隔将被修复。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何自动调整图像大小以适合Silverlight网格单元中已调整大小的画布 - How do I automatically resize an image to fit a resized canvas in a silverlight grid cell 当窗口在.net中最大化时,如何调整控件(面板,网格)本身的大小 - how can i make resize to controls(Panel ,Grid) itself when window is maximize in .net 如何在运行时调整网格上的WPF控件(保持纵横比) - How to resize WPF controls on a grid at runtime (keeping aspect ratio) 控件最大化时不会调整大小,但通过拖动来调整大小时-WPF - Controls do not resize when maximised but do when resized by dragging - wpf WPF网格中的自定义网格大小调整 - Custom grid resize in WPF grid 我已将表格与列表绑定 <int> (临时列表),如何在网格视图的项目模板中将列表文本选择到控件文本中 - I have binded a grid with List<int> (temporary list), how can i pick the list text into controls text in item template in grid view 如何在WPF中以编程方式滚动网格? - How can I scroll the grid programatically in WPF? 更改表单大小后,如何自动调整控件的大小? - How do I resize the controls automatically when form size is changed? WPF 如何根据里面的内容调整 Grid 的大小? - WPF How to resize Grid depending on the content inside? 如何在TabItem(WPF)中自动调整网格控件的大小? - How to auto resize grid control in a TabItem (WPF)?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM