共用方式為


BindingManagerBase.Bindings 屬性

定義

取得受管理的繫結集合。

public:
 property System::Windows::Forms::BindingsCollection ^ Bindings { System::Windows::Forms::BindingsCollection ^ get(); };
public System.Windows.Forms.BindingsCollection Bindings { get; }
member this.Bindings : System.Windows.Forms.BindingsCollection
Public ReadOnly Property Bindings As BindingsCollection

屬性值

BindingsCollection,包含接受這個 Binding 管理的 BindingManagerBase 物件。

範例

下列程式碼範例會取得 BindingManagerBase 特定資料來源的 。 然後,此範例會 Bindings 使用 屬性來列印系結至相同資料來源之每個控制項的相關資訊。

void PrintBoundControls()
{
   BindingManagerBase^ myBindingBase = this->BindingContext[ ds,"customers" ];
   System::Collections::IEnumerator^ myEnum = myBindingBase->Bindings->GetEnumerator();
   while ( myEnum->MoveNext() )
   {
      Binding^ b = safe_cast<Binding^>(myEnum->Current);
      Console::WriteLine( b->Control );
   }
}
private void PrintBoundControls()
{
   BindingManagerBase myBindingBase = this.BindingContext[ds, "customers"];
   foreach(Binding b in myBindingBase.Bindings)
   {
      Console.WriteLine(b.Control.ToString());
   }
}
Private Sub PrintBoundControls()
    Dim myBindingBase As BindingManagerBase = Me.BindingContext(ds, "customers")
    Dim b As Binding
    For Each b In  myBindingBase.Bindings
        Console.WriteLine(b.Control.ToString())
    Next b
End Sub

適用於

另請參閱