Reputation: 1555
I have a group box on a DockPanel in xaml. I want it to re size when the window re-sizes but it does not. Please help
<DockPanel LastChildFill="False" Height="Auto" Width="Auto" ForceCursor="False">
<GroupBox Header=" Select function" Height="183" HorizontalAlignment="Stretch" Margin="16,16,12,0" Name="groupBox1" VerticalContentAlignment="Top" Width="Auto">
</GroupBox>
<GroupBox Header=" Select function1" Height="183" HorizontalAlignment="Stretch" Margin="16,25,12,0" Name="groupBox2" VerticalContentAlignment="Top" Width="Auto">
</GroupBox>
</DockPanel>
Upvotes: 0
Views: 482
Reputation: 8843
Have you tried this?
<DockPanel LastChildFill="True" ForceCursor="False">
<GroupBox Header=" Select function" Height="183" Margin="16,16,12,0" Name="groupBox1" VerticalAlignment="Top">
</GroupBox>
</DockPanel>
I changed the LastChildFill
to True
and because you said you want the GroupBox
to be on Top I added VerticalAlignment="Top"
.
Upvotes: 1