I use a TextBlock within my GroupBox.Header to split my text across multiple lines. However, this means that the border is no longer exactly aligned with the text. The text extends beyond the GroupBox and the GroupBox does not adapt to the size of the text.
<GroupBox Grid.Row="2" Grid.Column="1" Margin="10, 5, 0, 0" FontSize="12" FontWeight="Bold" BorderBrush="Red">
<GroupBox.Header>
<TextBlock>
Entnahmen für <LineBreak/>
negative Befundung <LineBreak/>
scannen
</TextBlock>
</GroupBox.Header>
<TextBox />
</GroupBox>
What I want it to look like:
enter image description here
How it currently looks:
enter image description here
I also tried replacing the TextBlock with a Stackpanel.
Akin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.