I'm trying to make a GroupBox
in XAML that houses three RadioButton
s. Everything looks fine except that the 'g'
in my GroupBox
header is cut off at the bottom, like this:
I've read other posts with formatting issues, and have steered clear of positioning my different elements using margins. However, this doesn't seem to be my problem. I have built everything using grids (even inside my GroupBox
), but something is still cutting my header off. Any input would be appreciated!
This is what the GroupBox looks like when the font is normal and not bold:
Here is the part of my code with the GroupBox
:
<Grid Grid.Row="1">
<GroupBox Header="Current Units (English)" HorizontalAlignment="Stretch" Name="currentUnitsGroupBox" VerticalAlignment="Stretch" FontSize="12" FontWeight="Bold">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="6" />
<RowDefinition Height="*" />
<RowDefinition Height="4" />
</Grid.RowDefinitions>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width=".22*" />
<ColumnDefinition Width=".22*" />
<ColumnDefinition Width=".22*" />
<ColumnDefinition Width=".36*" />
</Grid.ColumnDefinitions>
<RadioButton
Content="System"
HorizontalAlignment="Stretch"
Name="systemRadio"
VerticalAlignment="Center"
FontSize="12"
FontWeight="Bold"
IsChecked="True"
Grid.Column ="0"
AutomationProperties.AutomationId="CurrentUnitsSystem"/>
<RadioButton
Content="English"
FontSize="12"
FontWeight="Bold"
HorizontalAlignment="Stretch"
Name="englishRadio"
VerticalAlignment="Center"
Grid.Column="1"
AutomationProperties.AutomationId="CurrentUnitsEnglish"/>
<RadioButton
Content="Metric"
FontSize="12"
FontWeight="Bold"
HorizontalAlignment="Stretch"
Name="metricRadio"
VerticalAlignment="Center"
Grid.Column="2"
AutomationProperties.AutomationId="CurrentUnitsMetric"/>
</Grid>
</Grid>
</GroupBox>
</Grid>
I've tested it with everything that came to my mind and im not able to reproduce it. Please try the following:
<GroupBox FontSize="12" FontWeight="Bold">
<GroupBox.Header>
<TextBlock Height="22" Text="Current Units (English)"/> </GroupBox.Header>
Since the Header in the GroupBox
is a TextBlock
anyway, we do the stuff now by ourself and adjust the height a little bit
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With