BindingManagerBase.Bindings BindingManagerBase.Bindings BindingManagerBase.Bindings BindingManagerBase.Bindings Property

定義

管理されているバインディングのコレクションを取得します。Gets the collection of bindings being managed.

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 オブジェクトを保持している BindingManagerBaseA BindingsCollection that contains the Binding objects managed by this BindingManagerBase.

次のコード例ではBindingManagerBase 、特定のデータソースのを取得します。The following code example gets the BindingManagerBase for a specific data source. この例では、 Bindingsプロパティを使用して、同じデータソースにバインドされている各コントロールに関する情報を出力します。The example then uses the Bindings property to print information about each control bound to the same data source.

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 'PrintBoundControls

適用対象

こちらもご覧ください