ControlBindingsCollection.RemoveAt(Int32) Metoda

Definice

Odstraní objekt Binding v zadaném indexu.

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

Parametry

index
Int32

Z nuly vycházející index položky k odebrání.

Výjimky

Hodnota index je menší než 0 nebo je větší než počet vazeb v kolekci.

Příklady

Následující příklad kódu používá Count vlastnost k určení, zda index je v rozsahu kolekce. Pokud ano, třetí Binding se odebere.

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

Poznámky

K CollectionChanged události dojde v případě, že odebrání proběhne úspěšně.

Platí pro