RowDefinitionCollection.RemoveAt(Int32) Méthode

Définition

Supprime un RowDefinition d'un RowDefinitionCollection à la position d'index spécifiée.

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)

Paramètres

index
Int32

Position dans la collection à laquelle le RowDefinition est supprimé.

Implémente

Exemples

L’exemple suivant montre comment utiliser la RemoveAt méthode pour supprimer un RowDefinition à un RowDefinitionCollection à une position spécifique index .

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

Pour afficher l’exemple complet, consultez How to: Manipulate Columns and Rows by Using ColumnDefinitionsCollections and RowDefinitionsCollections.

Remarques

RowDefinitionCollection utilise un système d’indexation de base zéro.

S’applique à

Voir aussi