How di I make a newline in the text for a checkbox? I’ve tried \n but it didn’t work?
EDIT: this is my CheckBox
<CheckBox xml:space="preserve" Height="16" HorizontalAlignment="Left" Margin="360,46,0,0" Name="ShowOldRegistrations" VerticalAlignment="Top" Checked="ShowOldRegistrations_Checked" Unchecked="ShowOldRegistrations_UnChecked">
<StackPanel Height="42" Width="108">
<TextBlock>Line1</TextBlock>
<TextBlock>Line2</TextBlock>
</StackPanel>
</CheckBox>
In WPF, you can put any control almost anywhere. So you could try this:
Also, you need to remove the
Heightproperty from your checkbox. Of course only one line gets displayed if the height doesn’t permit displaying more.In WPF, in most cases you don’t need to (nor should) specify absolute dimensions for your controls. They can adjust automatically quite well.