c# 代码背后的网格星大小


1 Answers

grid.RowDefinitions[0].Height = new GridLength(0.5, GridUnitType.Star);
c# wpf xaml grid

我有一个网格如下,

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

如何在代码中给出Height = "0.5*"



Related


Tags

c#   wpf   xaml   grid