Edit

Share via


TextWrapping Enum

Definition

Specifies whether text wraps when it reaches the edge of the containing box.

public enum class TextWrapping
[System.Windows.Localizability(System.Windows.LocalizationCategory.None, Readability=System.Windows.Readability.Unreadable)]
public enum TextWrapping
[<System.Windows.Localizability(System.Windows.LocalizationCategory.None, Readability=System.Windows.Readability.Unreadable)>]
type TextWrapping = 
Public Enum TextWrapping
Inheritance
TextWrapping
Attributes

Fields

Name Value Description
WrapWithOverflow 0

Line-breaking occurs if the line overflows beyond the available block width. However, a line may overflow beyond the block width if the line breaking algorithm cannot determine a line break opportunity, as in the case of a very long word constrained in a fixed-width container with no scrolling allowed.

NoWrap 1

No line wrapping is performed.

Wrap 2

Line-breaking occurs if the line overflows beyond the available block width, even if the standard line breaking algorithm cannot determine any line break opportunity, as in the case of a very long word constrained in a fixed-width container with no scrolling allowed.

Examples

The following example demonstrates how to set the value of the TextWrapping property of a TextBox.

private void wrapOff(object sender, RoutedEventArgs e)
{
    myTextBox.TextWrapping = TextWrapping.NoWrap;
}
Private Sub wrapOff(ByVal sender As Object, ByVal e As RoutedEventArgs)
    myTextBox.TextWrapping = TextWrapping.NoWrap
End Sub

Applies to