ControlBindingsCollection.Remove(Binding) ControlBindingsCollection.Remove(Binding) ControlBindingsCollection.Remove(Binding) Method

定义

从集合中删除指定的 BindingDeletes the specified Binding from the collection.

public:
 void Remove(System::Windows::Forms::Binding ^ binding);
public void Remove (System.Windows.Forms.Binding binding);
override this.Remove : System.Windows.Forms.Binding -> unit

参数

binding
Binding Binding Binding

要移除的 BindingThe Binding to remove.

异常

bindingnullThe binding is null.

示例

下面的代码示例Binding TextBox从控件的ControlBindingsCollection中移除特定的。The following code example removes a specific Binding from a TextBox control's ControlBindingsCollection. Binding示例通过Item[String]使用Remove属性获取所需的, 并使用方法删除。 BindingThe example gets the required Binding by using the Item[String] property, and removes the Binding with the Remove method.

void RemoveBackColorBinding()
{
   Binding^ colorBinding = textBox1->DataBindings[ "BackColor" ];
   textBox1->DataBindings->Remove( colorBinding );
}

private void RemoveBackColorBinding()
{
   Binding colorBinding = textBox1.DataBindings["BackColor"];
   textBox1.DataBindings.Remove(colorBinding);
}
Private Sub RemoveBackColorBinding()
    Dim colorBinding As Binding = textBox1.DataBindings("BackColor")
    textBox1.DataBindings.Remove(colorBinding)
End Sub

适用于