Text Property

TextBox.Text Property

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

Gets or sets the text contents of the text box.

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

public string Text { get; set; }
<TextBox Text="string"/>

Property Value

Type: System.String
A string containing the text contents of the text box. The default is an empty string ("").

ExceptionCondition
ArgumentNullException

The value is set to null.

Getting this property returns a string copy of the contents of the text box. Setting this property replaces the contents of the text box with the specified string.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2016 Microsoft