Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 417
Itay Grudev Avatar asked Dec 06 '22 16:12

Itay Grudev


2 Answers

Set the TextWrapping property of the textbox to Wrap

like image 54
Louis Kottmann Avatar answered Dec 29 '22 12:12

Louis Kottmann


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

like image 42
dowhilefor Avatar answered Dec 29 '22 13:12

dowhilefor