Share via


TextBox.Text Property

Definition

Gets or sets the text contents of the text box.

public:
 property Platform::String ^ Text { Platform::String ^ get(); void set(Platform::String ^ value); };
winrt::hstring Text();

void Text(winrt::hstring value);
public string Text { get; set; }
var string = textBox.text;
textBox.text = string;
Public Property Text As String
<TextBox Text="string"/>

Property Value

String

Platform::String

winrt::hstring

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

Remarks

This property is not nullable. However, if you set this property to null (TextBox1.Text = null;) no exception is thrown. Instead, it is automatically set to an empty string ("").

Applies to