RowDefinitionCollection.RemoveAt(Int32) Metode

Definisi

RowDefinition Menghapus dari RowDefinitionCollection pada posisi indeks yang ditentukan.

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)

Parameter

index
Int32

Posisi dalam koleksi tempat RowDefinition dihapus.

Penerapan

Contoh

Contoh berikut menunjukkan cara menggunakan RemoveAt metode untuk menghapus RowDefinition ke RowDefinitionCollection pada posisi tertentu 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

Untuk melihat sampel lengkap, lihat Cara: Memanipulasi Kolom dan Baris dengan Menggunakan ColumnDefinitionsCollections dan RowDefinitionsCollections.

Keterangan

RowDefinitionCollection menggunakan sistem pengindeksan berbasis nol.

Berlaku untuk

Lihat juga