Binding.BindingManagerBase Property

Definition

获取此 BindingManagerBaseBindingGets the BindingManagerBase for this Binding.

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

Property Value

BindingManagerBase

管理该 BindingManagerBaseBindingThe BindingManagerBase that manages this Binding.

Examples

下面的代码示例获取窗体上每个 BindingBindingManagerBase,并打印每个 BindingManagerBasePosition 属性。The following code example gets the BindingManagerBase of every Binding on the form, and prints the Position property for each BindingManagerBase.

private:
   void PrintPositions()
   {
      for each ( Control^ c in this->Controls )
      {
         for each ( Binding^ xBinding in c->DataBindings )
         {
            Console::WriteLine(
               "{0}\t Position: {1}",
               c, xBinding->BindingManagerBase->Position );
         }
      }
   }
private void PrintPositions()
{
   foreach(Control c in this.Controls)
   {
      foreach(Binding xBinding in c.DataBindings)
      {
         Console.WriteLine
         (c.ToString() + "\t Position: " + 
         xBinding.BindingManagerBase.Position);
      }
   }
}

Private Sub PrintPositions
    Dim c As Control
    Dim xBinding As Binding
    For Each c In Me.Controls
        For Each xBinding In c.DataBindings
            Console.WriteLine(c.ToString & ControlChars.Tab & " Position: " & _
                xBinding.BindingManagerBase.Position)
        Next
    Next
End Sub

Remarks

通过递增或递减 Position 属性,使用 BindingManagerBase 来循环访问数据绑定列表。Use the BindingManagerBase to iterate through a data-bound list by incrementing or decrementing the Position property. BindingManagerBase 类是抽象类。The BindingManagerBase class is abstract. 用于管理数据绑定列表的 CurrencyManager 类继承自 BindingManagerBase 类。The CurrencyManager class, which manages data-bound lists, inherits from the BindingManagerBase class.

Applies to