ControlBindingsCollection.Remove(Binding) Método

Definición

Elimina el elemento Binding especificado de la colección.Deletes 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
Public Sub Remove (binding As Binding)

Parámetros

binding
Binding

Binding que se va a quitar.The Binding to remove.

Excepciones

El valor de binding es null.The binding is null.

Ejemplos

En el ejemplo de código siguiente se quita un específico Binding de un TextBox control ControlBindingsCollection .The following code example removes a specific Binding from a TextBox control's ControlBindingsCollection. En el ejemplo se obtiene el requerido mediante Binding el uso de la Item[] propiedad y se quita el Binding con el Remove método.The example gets the required Binding by using the Item[] 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

Se aplica a