Itay Grudev
Itay Grudev

Reputation: 7426

WPF XAML TextBlock Send Content to New Line

I have a TextBlock, like this one:

<ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto">
    <TextBlock Name="PatchNotesTxt" Width="291" Height="226" Style="{StaticResource PatchNotes}">
        Test Test Test Test Test Test Test Test Test Test Test Test Test Test TEST
    </TextBlock>
</ScrollViewer>

But the problem is that when the content reaches the end of the TextBlock it isn't transfered to a new line. How am I supposed to achieve that?

Upvotes: 6

Views: 5557

Answers (2)

dowhilefor
dowhilefor

Reputation: 11051

Use the TextWrapping property on the TextBlock. <TextBlock TextWrapping="Wrap"/>

Upvotes: 4

Louis Kottmann
Louis Kottmann

Reputation: 16618

Set the TextWrapping property of the textbox to Wrap

Upvotes: 14

Related Questions