RowDefinitionCollection.RemoveRange(Int32, Int32) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
從 中RowDefinition移除一系列RowDefinitionCollection物件。
public:
void RemoveRange(int index, int count);
public void RemoveRange(int index, int count);
member this.RemoveRange : int * int -> unit
Public Sub RemoveRange (index As Integer, count As Integer)
參數
- index
- Int32
在集合中移除第一個 RowDefinition 字母的位置。
- count
- Int32
從收藏中移除的物件總數 RowDefinition 。
範例
以下範例示範如何利用此 RemoveRange 方法從 中移除一組 RowDefinition 元素 RowDefinitionCollection。
private void rem5Row(object sender, RoutedEventArgs e)
{
if (grid1.RowDefinitions.Count < 5)
{
tp1.Text = "There aren't five Rows to Remove!";
}
else
{
grid1.RowDefinitions.RemoveRange(0, 5);
}
}
Private Sub rem5Row(ByVal sender As Object, ByVal e As RoutedEventArgs)
If (grid1.RowDefinitions.Count < 5) Then
tp1.Text = "There aren't five Rows to Remove!"
Else
grid1.RowDefinitions.RemoveRange(0, 5)
End If
End Sub
欲查看完整範例,請參閱 「如何:使用 ColumnDefinitionsCollections 與 RowDefinitionsCollections 操作欄位與列」。
備註
RowDefinitionCollection 使用零基索引系統。