ToolStrip.BindingContext 屬性


取得或設定 ToolStrip 的繫結內容。Gets or sets the binding context for the ToolStrip.

 virtual property System::Windows::Forms::BindingContext ^ BindingContext { System::Windows::Forms::BindingContext ^ get(); void set(System::Windows::Forms::BindingContext ^ value); };
public override System.Windows.Forms.BindingContext BindingContext { get; set; }
member this.BindingContext : System.Windows.Forms.BindingContext with get, set
Public Overrides Property BindingContext As BindingContext



BindingContextToolStripA BindingContext for the ToolStrip.


的會 BindingContext ToolStrip 針對所包含的 BindingManagerBase 所有資料繫結控制項傳回單一 ToolStripThe BindingContext of a ToolStrip returns a single BindingManagerBase for all data-bound controls contained by the ToolStrip. BindingManagerBase會讓系結至相同資料來源的所有控制項保持同步。The BindingManagerBase keeps all controls that are bound to the same data source synchronized. 例如,設定的 Position 屬性 BindingManagerBase 會指定基礎清單中所有資料繫結控制項所指向的專案。For example, setting the Position property of the BindingManagerBase specifies the item in the underlying list that all data-bound controls point to.

如需建立新的, BindingContext 並將它指派給屬性的詳細資訊 BindingContext ,請參閱函式 BindingContextFor more information about creating a new BindingContext and assigning it to the BindingContext property, see the BindingContext constructor.


覆寫 BindingContext 衍生類別中的屬性時,請使用基類的 BindingContext 屬性來擴充基底實作為。When overriding the BindingContext property in a derived class, use the base class's BindingContext property to extend the base implementation. 否則,您必須提供所有的實作為。Otherwise, you must provide all the implementation. 您不需要覆寫 get 屬性的和 set 存取子 BindingContext ,您可以視需要覆寫其中一個。You are not required to override both the get and set accessors of the BindingContext property; you can override only one, if needed.