GroupBox Header Text Disabled

I am trying to make a GroupBox in XAML, in which there are three RadioButton s. Everything looks great except that the 'g' header in my GroupBox header GroupBox trimmed at the bottom, for example:

Screenshothot one

I read other posts with formatting problems and avoided positioning my different elements using fields. However, this does not seem to be a problem. I built everything using meshes (even inside my GroupBox ), but something else disables my header. Any input would be appreciated!

This is what GroupBox looks like when the font is normal and not bold:

Screenshothot two

Here is part of my code with 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> 
+6
source share
1 answer

I checked it with everything that occurred to me, and I could not reproduce it. Try the following:

 <GroupBox FontSize="12" FontWeight="Bold"> <GroupBox.Header> <TextBlock Height="22" Text="Current Units (English)"/> </GroupBox.Header> 

Since the Header in GroupBox is a TextBlock , in any case, we do it now ourselves and adjust the height a little

+7
source

All Articles