ControlBindingsCollection.RemoveAt(Int32) メソッド

定義

指定したインデックスの Binding を削除します。

public:
 void RemoveAt(int index);
public void RemoveAt (int index);
override this.RemoveAt : int -> unit
Public Sub RemoveAt (index As Integer)

パラメーター

index
Int32

削除する項目の 0 から始まるインデックス。

例外

index の値が 0 未満か、コレクション内のバインディング数を超えています。

次のコード例では、 プロパティを Count 使用して、インデックスがコレクションの範囲内にあるかどうかを判断します。 その場合、3 番目 Binding の が削除されます。

private:
   void RemoveThirdBinding()
   {
      if ( textBox1->DataBindings->Count < 3 )
      {
         return;
      }
      textBox1->DataBindings->RemoveAt( 2 );
   }
private void RemoveThirdBinding()
{
   if(textBox1.DataBindings.Count < 3) return;
   textBox1.DataBindings.RemoveAt(2);
}
Private Sub RemoveThirdBinding()
    If textBox1.DataBindings.Count < 3 Then
        Return
    End If
    textBox1.DataBindings.RemoveAt(2)
End Sub

注釈

このイベントは CollectionChanged 、削除が成功した場合に発生します。

適用対象