Grid row star height doesn't behave like WPF

s0crates
Posts: 1
Joined: Mon Nov 28, 2016 3:09 am

Grid row star height doesn't behave like WPF

Postby s0crates » Mon Nov 28, 2016 3:15 am

Code: Select all

<Grid HorizontalAlignment="Stretch" Background="White" VerticalAlignment="Stretch">
        <Grid.RowDefinitions>
            <RowDefinition Height="*"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="*"></RowDefinition>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"></ColumnDefinition>
            <ColumnDefinition Width="7*"></ColumnDefinition>
            <ColumnDefinition Width="*"></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <TextBox Text="Hello World!" Grid.Column="1" Height="30" Grid.Row="1"
                 x:Name="TextBlock1" HorizontalAlignment="Stretch" VerticalAlignment="Top"
                 TextAlignment="Center" VerticalContentAlignment="Center" />
    </Grid>


So I have a grid with the above row definitions. This should force the textbox to be in the middle of the screen, but for some reason it appears in the bottom.

I know I could simply have one * row and set vertical center, but since I plan to have more rows and controls in the middle, I need this specific setup.

Thoughts on this?

Return to “General Discussion and Other”

Who is online

Users browsing this forum: No registered users and 2 guests

 

 

cron