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




1 Answers

您可以使用:

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

我有一个网格如下,

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

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




Related


Tags

c#   wpf   xaml   grid