BindingManagerBase.Bindings Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
Property Value
A BindingsCollection that contains the Binding objects managed by this BindingManagerBase.
Examples
The following code example gets the BindingManagerBase for a specific data source. 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
Applies to
See also
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
.NET