TextBox.Text 属性

定义

获取或设置文本框的文本内容。Gets or sets the text contents of the text box.

public:
 property System::String ^ Text { System::String ^ get(); void set(System::String ^ value); };
[System.Windows.Localizability(System.Windows.LocalizationCategory.Text)]
public string Text { get; set; }
member this.Text : string with get, set
Public Property Text As String

属性值

包含此文本框的文本内容的字符串。A string containing the text contents of the text box. 默认值为空字符串("")。The default is an empty string ("").

属性

注解

获取此属性将返回文本框内容的字符串副本。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.

此属性不支持动画。This property does not support animation.

在数据绑定方案中使用时, 此属性使用的UpdateSourceTrigger.LostFocus默认更新行为。When used in data-binding scenarios, this property uses the default update behavior of UpdateSourceTrigger.LostFocus.

XAML 属性元素用法XAML Property Element Usage

<object>  
  String  
</object>  

依赖项属性信息Dependency Property Information

标识符字段Identifier field TextProperty
元数据属性设置为trueMetadata properties set to true BindsTwoWayByDefaultJournalBindsTwoWayByDefault, Journal

适用于

另请参阅