BindingManagerBase.Bindings 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得受管理的繫結集合。
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