語言

VisualCollection.RemoveAt(Int32) 方法

定義

移除指定索引 VisualCollection處的視覺物件。

public:
 void RemoveAt(int index);
public void RemoveAt(int index);
member this.RemoveAt : int -> unit
Public Sub RemoveAt (index As Integer)

參數

index
Int32

視覺的零基索引要移除。

例外狀況

index 小於零,或 index 等於或大於 Count。

備註

跟隨被移除物件的視覺物件會被移位至空出的位置,並更新其索引值。

此 RemoveAt 方法同時移除父視覺化(即 的 VisualCollection擁有者)與子 visual節點之間的父子關係。

如果你需要對視覺子物件底層儲存實作有更深的低階控制,可以考慮使用 AddVisualChild and RemoveVisualChild 方法。 使用這些方法時,你會定義自己的儲存實作,而非使用 VisualCollection。

適用於