ControlBindingsCollection.Remove(Binding) 方法

定义

从集合中删除指定的 Binding

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

参数

binding
Binding

要移除的 Binding

例外

bindingnull

示例

下面的代码示例从控件ControlBindingsCollection中删除特定BindingTextBox项。 该示例使用Item[]属性获取所需的Binding属性,并删除Binding该方法Remove

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

适用于