Share via


NumberBox.Text 屬性

定義

取得或設定 Value 屬性的字串類型表示。

本檔適用于 Windows 應用程式 SDK 中適用于 WinUI 的 WinUI 2 for UWP (,請參閱Windows 應用程式 SDK命名空間) 。

public:
 property Platform::String ^ Text { Platform::String ^ get(); void set(Platform::String ^ value); };
/// [get: Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)]
/// [set: Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)]
winrt::hstring Text();

void Text(winrt::hstring value);
/// [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)]
/// [get: Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)]
/// [set: Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)]
winrt::hstring Text();

void Text(winrt::hstring value);
public string Text { [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)] get; [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)] set; }
[Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)]
public string Text { [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)] get; [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)] set; }
Public Property Text As String

屬性值

String

Platform::String

winrt::hstring

屬性
Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallbackAttribute

備註

這個屬性可用來取得 Value數值內容的字串表示,而不需要類型轉換。 請注意 ,Value 的內容將會在初始設定中覆寫此屬性的內容。 初始設定之後,對其中一個的變更將會傳播到另一個變更,但持續透過 Value 進行程式設計變更有助於避免任何概念上的誤解,讓 NumberBox 透過此屬性接受非數值字元。

適用於