Open cxnky opened 2 months ago
I have the following XAML
<w3c:GroupBox Grid.Row="0" Grid.Column="0" Heading="test" HorizontalAlignment="Stretch" VerticalAlignment="Top" MinWidth="300"> <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch"> <Grid.RowDefinitions> <RowDefinition Height="Auto" /> <RowDefinition Height="Auto" /> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto" /> <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions> <TextBox x:Name="Test" Header="Test ID:" Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Top" Grid.Row="0" /> <TextBox x:Name="Test2" Header="Test ID:" Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Top" Grid.Row="1" Margin="0,10,0,0" /> </Grid> </w3c:GroupBox>
and the Stretch property is not working properly, as I just see this
Stretch
The textboxes do, however, resize when you type in them
Instead of setting the GroupBox property HorizontalAlignment="Stretch" you should set HorizontalContentAlignment="Stretch"
HorizontalAlignment="Stretch"
HorizontalContentAlignment="Stretch"
That should fix the problem you are seeing.
I have the following XAML
and the
Stretch
property is not working properly, as I just see thisThe textboxes do, however, resize when you type in them