RowDefinitionCollection.RemoveAt(Int32) Metoda

Definicja

Usuwa obiekt RowDefinition z obiektu RowDefinitionCollection na określonej pozycji indeksu.

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

Parametry

index
Int32

Pozycja w kolekcji, w której RowDefinition jest usuwana.

Implementuje

Przykłady

W poniższym przykładzie pokazano, jak za pomocą RemoveAt metody usunąć RowDefinition element do obiektu RowDefinitionCollection w określonej index pozycji.

private void removeRow(object sender, RoutedEventArgs e)
{
    if (grid1.RowDefinitions.Count <= 0)
    {
        tp1.Text = "No More Rows to Remove!";
    }
    else
    {
        grid1.RowDefinitions.RemoveAt(0);
    }
}
Private Sub removeRow(ByVal sender As Object, ByVal e As RoutedEventArgs)
    If (grid1.RowDefinitions.Count <= 0) Then
        tp1.Text = "No More Rows to Remove!"
    Else
        grid1.RowDefinitions.RemoveAt(0)
    End If
End Sub

Aby wyświetlić kompletny przykład, zobacz How to: Manipulate Columns and Rows by Using ColumnDefinitionsCollections and RowDefinitionsCollections (Instrukcje: manipulowanie kolumnami i wierszami przy użyciu kolekcji ColumnDefinitionsCollections i RowDefinitionsCollections).

Uwagi

RowDefinitionCollection używa systemu indeksowania opartego na zera.

Dotyczy

Zobacz też