Reputation: 5709
I have a fairly simple setup so far which looks like this:
As you can see Number 3 looks perfectly fine. The other two however does not. I have the following code:
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<StackPanel Grid.Row="0" Orientation="Vertical" Margin="0,0,5,0" Background="#FFEAEAEA">
<GroupBox x:Name="playStyleBox" Header="1. Play Style" HorizontalAlignment="Left" Margin="10,0,10,0" VerticalAlignment="Top">
<UniformGrid Columns="4">
<CheckBox x:Name="CheckBoxSubtle">Subtle</CheckBox>
<CheckBox x:Name="CheckBoxBalanced">Balanced</CheckBox>
<CheckBox x:Name="CheckBoxAggressive">Aggressive</CheckBox>
<CheckBox x:Name="CheckBoxSupportive">Supportive</CheckBox>
</UniformGrid>
</GroupBox>
<GroupBox x:Name="playStyleSubBox" Header="2. Sub Play Style" HorizontalAlignment="Left" Margin="10,0,10,0" VerticalAlignment="Top">
<UniformGrid Columns="3">
<CheckBox x:Name="CheckBoxMelee">Melee</CheckBox>
<CheckBox x:Name="CheckBoxRanged">Ranged</CheckBox>
<CheckBox x:Name="CheckBoxMagic">Magic</CheckBox>
</UniformGrid>
</GroupBox>
<GroupBox x:Name="alignmentBox" Header="3. Alignment" HorizontalAlignment="Left" Margin="10,0,5,0" VerticalAlignment="Top">
<UniformGrid Columns="3">
<CheckBox x:Name="CheckBoxLawfulGood">Lawful Good</CheckBox>
<CheckBox x:Name="CheckBoxNeutralGood">Neutral Good</CheckBox>
<CheckBox x:Name="CheckBoxChaoticGood">Chaotic Good</CheckBox>
<CheckBox x:Name="CheckBoxLawfulNeutral">Lawful Neutral</CheckBox>
<CheckBox x:Name="CheckBoxNeutral">Neutral</CheckBox>
<CheckBox x:Name="CheckBoxChaoticNeutral">Chaotic Neutral</CheckBox>
<CheckBox x:Name="CheckBoxLawfulEvil">Lawful Evil</CheckBox>
<CheckBox x:Name="CheckBoxNeutralEvil">Neutral Evil</CheckBox>
<CheckBox x:Name="CheckBoxChaoticEvil">Chaotic Evil</CheckBox>
</UniformGrid>
</GroupBox>
</StackPanel>
<GridSplitter Grid.Column="0" Width="4" BorderBrush="Red" VerticalAlignment="Stretch">
<GridSplitter.Template>
<ControlTemplate TargetType="{x:Type GridSplitter}">
<Grid>
<Button Content="⁞"/>
<Rectangle Fill="#FFACACAC"/>
</Grid>
</ControlTemplate>
</GridSplitter.Template>
</GridSplitter>
</Grid>
Any help would be appreciated. I am pretty lost as to why this happens to the first two UniformGrid's but not the last one.
Upvotes: 0
Views: 1188
Reputation: 9827
UniformGrid
create Columns
of equal size. So, largest control governs the size of the Column
.
Set HorizontalAlignment="Stretch"
, and Margin="10,0,10,0"
in all GroupBox
.
Change number of Columns
in first UniformGrid
to 3.
Upvotes: 1