Share via


TextBox.Text 屬性

定義

取得或設定文字方塊的文字內容。

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; }
[<System.Windows.Localizability(System.Windows.LocalizationCategory.Text)>]
member this.Text : string with get, set
Public Property Text As String

屬性值

String

包含文字方塊之文字內容的字串。 預設為空字串 ("")。

屬性

備註

取得此屬性會傳回文字方塊內容的字串複本。 設定此屬性會將文字方塊的內容取代為指定的字串。

此屬性不支援動畫。

在資料系結案例中使用時,這個屬性會使用 的預設更新行為 UpdateSourceTrigger.LostFocus

XAML 屬性項目用法

<object>  
  String  
</object>  

相依性屬性資訊

識別碼欄位 TextProperty
設定為 的中繼資料屬性 true BindsTwoWayByDefault, Journal

適用於

另請參閱