Reputation: 309
In the XAML, we can use the to wrap;
<TextBlock Height="219" HorizontalAlignment="Left" Margin="12,330,0,0" Name="textBlock1"
Text="TextBlock TextBlock" TextWrapping="NoWrap" VerticalAlignment="Top" Width="438" />
But i use the code like this:
this.textBlock1.Text = "TextBlock TextBlock";
It doesn't wrap. I want to how to make it work in the .cs file.
Upvotes: 1
Views: 321
Reputation: 108967
this.textBlock1.Text = "TextBlock" + Environment.NewLine + "TextBlock";
but "TextBlock TextBlock"
is equal to "TextBlock\rTextBlock"
Upvotes: 4