共用方式為


BindingBase.StringFormat 屬性

定義

取得或設定這個繫結的字串格式。

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}"
});

適用於

另請參閱