ControlBindingsCollection.Remove(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
が null
です。The binding
is null
.
例
次のコード例では、コントロールのから特定のを削除し Binding TextBox ControlBindingsCollection ます。The following code example removes a specific Binding from a TextBox control's ControlBindingsCollection. この例では、プロパティを使用して必要なを取得し、メソッドを使用してを Binding Item[] 削除し Binding Remove ます。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