ControlBindingsCollection.Remove(Binding) Method

Definition

Deletes the specified Binding from the collection.

C#
public void Remove(System.Windows.Forms.Binding binding);

Parameters

binding
Binding

The Binding to remove.

Exceptions

The binding is null.

Examples

The following code example removes a specific Binding from a TextBox control's ControlBindingsCollection. The example gets the required Binding by using the Item[] property, and removes the Binding with the Remove method.

C#
private void RemoveBackColorBinding()
{
   Binding colorBinding = textBox1.DataBindings["BackColor"];
   textBox1.DataBindings.Remove(colorBinding);
}

Applies to

Product Versions
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10