积极答复者
怎么在style中设置一个控件能占满grid一个单元格?

问题
答案
-
Hi Trian555,
如果我们先不管你用的一些第三方样式, 只是回答你所说的想让一个控件占满grid的一个单元格的话, 你可以设置如下:
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
<Button Name="btn2" Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Content="btn2" />
Best Regards,
Cherry
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.- 已标记为答案 Trian555 2019年1月7日 6:17
全部回复
-
Hi Trian555,
如果我们先不管你用的一些第三方样式, 只是回答你所说的想让一个控件占满grid的一个单元格的话, 你可以设置如下:
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
<Button Name="btn2" Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Content="btn2" />
Best Regards,
Cherry
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.- 已标记为答案 Trian555 2019年1月7日 6:17