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

適用於

另請參閱