网格星号在代码后面 [英] Grid Star-Size in code behind

查看:103
本文介绍了网格星号在代码后面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网格如下,

 < Grid> 
< Grid.RowDefinitions>
< RowDefinition Height =0.5 */>
< RowDefinition Height =0.5 */>
< /Grid.RowDefinitions>
< / Grid>

我如何给 Height =0.5 *


$ b $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ pre> rowDefinition.Height = new GridLength(0.5,GridUnitType.Star);


I have a grid as follows,

<Grid>
    <Grid.RowDefinitions>
        <RowDefinition Height="0.5*" />
        <RowDefinition Height="0.5*" />
    </Grid.RowDefinitions>
</Grid>

How do I give the Height = "0.5*" in code behind?

解决方案

You can use:

rowDefinition.Height = new GridLength(0.5, GridUnitType.Star);

这篇关于网格星号在代码后面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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