VisualCollection.RemoveRange(Int32, Int32) 方法

定義

VisualCollection 移除某範圍的視覺物件。

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

要移除之項目範圍的以零起始的索引。

count
Int32

要移除的項目數目。

例外狀況

index 小於零,或 count 小於零。

indexcount 未參照 VisualCollection 中的有效項目範圍。

備註

在移除的物件後面的視覺物件會移位以佔用空置的位置,並更新其索引值。

方法 RemoveRange 也會移除父視覺效果之間的父子關聯性,也就是 的擁有者 VisualCollection ,以及子視覺效果的範圍。

如果您需要對視覺子物件的基礎儲存實作進行更高的低階控制,請考慮使用 AddVisualChildRemoveVisualChild 方法。 當您使用這些方法時,您會定義自己的儲存體實作,而且不使用 VisualCollection

適用於