Grid Star-Size in code behind(Grid Star-Size 在后面的代码中)
问题描述
我有一个网格如下,
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="0.5*" />
<RowDefinition Height="0.5*" />
</Grid.RowDefinitions>
</Grid>
如何在后面的代码中给出 Height = "0.5*"
?
How do I give the Height = "0.5*"
in code behind?
推荐答案
你可以使用:
rowDefinition.Height = new GridLength(0.5, GridUnitType.Star);
这篇关于Grid Star-Size 在后面的代码中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!