RowDefinitionCollection.RemoveAt(Int32) RowDefinitionCollection.RemoveAt(Int32) RowDefinitionCollection.RemoveAt(Int32) RowDefinitionCollection.RemoveAt(Int32) Method

定義

RowDefinition 的指定索引位置移除 RowDefinitionCollectionRemoves a RowDefinition from a RowDefinitionCollection at the specified index position.

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)

參數

index
Int32 Int32 Int32 Int32

要移除之 RowDefinition 在集合內的位置。The position within the collection at which the RowDefinition is removed.

實作

範例

下列範例示範RemoveAt如何使用方法, RowDefinitionCollection在特定index位置RowDefinition移除的。The following example demonstrates how to use the RemoveAt method to remove a RowDefinition to a RowDefinitionCollection at a specific index position.

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

若要查看完整的範例, 請參閱如何:使用 ColumnDefinitionsCollections 和 Rowdefinitionscollections 管理資料運算元據行和資料列。To view the complete sample, see How to: Manipulate Columns and Rows by Using ColumnDefinitionsCollections and RowDefinitionsCollections.

備註

RowDefinitionCollection使用以零為基底的索引系統。RowDefinitionCollection uses a zero-based indexing system.

適用於

另請參閱