TextWrapping Property

RichTextBox.TextWrapping Property

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Gets or sets how text wrapping occurs if a line of text extends beyond the available width of the RichTextBox.

Namespace:  System.Windows.Controls
Assembly:  System.Windows (in System.Windows.dll)
XMLNS for XAML: Not mapped to an xmlns.

public TextWrapping TextWrapping { get; set; }
<RichTextBox TextWrapping="Wrap"/>
<RichTextBox TextWrapping="NoWrap"/>

Property Value

Type: System.Windows.TextWrapping
One of the TextWrapping values. The default is Wrap.

You should consider the width of the RichTextBox when you set the TextWrapping property. Any text that extends beyond the bounds of the RichTextBox will not be displayed. If the TextWrapping property is set to NoWrap, text that exceeds the horizontal bounds can be scrolled into view using the cursor. If the TextWrapping property is set to Wrap, the HorizontalScrollBarVisibility property is automatically set to Disabled and any property changes to the HorizontalScrollBarVisibility are ignored.

The following XAML shows how to use the TextWrapping property.

<RichTextBox Margin="20,20,0,0" Width="300" Height="50" TextWrapping="Wrap" AcceptsReturn="True">
        A RichTextBox that demonstrates TextWrapping and AcceptsReturn properties

Windows Phone OS

Supported in: 8.1, 8.0, 7.1

Windows Phone

© 2017 Microsoft