BindingBase.StringFormat 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得或設定這個繫結的字串格式。
public:
property System::String ^ StringFormat { System::String ^ get(); void set(System::String ^ value); };
public string StringFormat { get; set; }
member this.StringFormat : string with get, set
Public Property StringFormat As String
屬性值
指定這個系結值之格式的字串。
備註
用於提供系結值的顯示格式,或與其他文字組合值。 實 BindingBase 作者決定如何使用字串格式,但所有都支援標準 Format 慣例。
Binding 允許其單一值的一個引數。
顯示撰寫文字的簡單範例,以及使用 來判斷值的顯示格式 Binding
Label label = new Label();
label.AddBinding (new Binding (Label.TextProperty, "Price") {
StringFormat = "Price: {0:C2}"
});