WPF XAML TextBlock Send Content to New Line
Asked Answered
H

2

6

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?

Heavyduty answered 5/3, 2012 at 13:4 Comment(0)
M
14

Set the TextWrapping property of the textbox to Wrap

Minster answered 5/3, 2012 at 13:6 Comment(0)
F
4

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

Fda answered 5/3, 2012 at 13:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.