Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

TextBox.TextWrapping Property

Gets or sets a value that indicates how the TextBox should wrap text.

Namespace: System.Windows.Controls
Assembly: PresentationFramework (in presentationframework.dll)
XML Namespace:  http://schemas.microsoft.com/winfx/2006/xaml/presentation

public TextWrapping TextWrapping { get; set; }
/** @property */
public TextWrapping get_TextWrapping ()

/** @property */
public void set_TextWrapping (TextWrapping value)

public function get TextWrapping () : TextWrapping

public function set TextWrapping (value : TextWrapping)

<object TextWrapping="TextWrapping" .../>

Property Value

A value indicating how the TextBox should wrap text. The default value is NoWrap.

Setting the TextWrapping attribute to Wrap will cause entered text to wrap to a new line when the edge of the TextBox control is reached, automatically expanding the height of the TextBox control to include room for a new line, if necessary.

The following example demonstrates how to set the value of this property.

private void wrapOff(object sender, RoutedEventArgs e)
{
    myTextBox.TextWrapping = TextWrapping.NoWrap;
}

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions

Show:
© 2014 Microsoft