語言

ItemCollection.RemoveAt(Int32) 方法

定義

移除集合或檢視指定索引的項目。

public:
 virtual void RemoveAt(int removeIndex);
public void RemoveAt(int removeIndex);
abstract member RemoveAt : int -> unit
override this.RemoveAt : int -> unit
Public Sub RemoveAt (removeIndex As Integer)

參數

removeIndex
Int32

要移除的項目的零基指數。

實作

例外狀況

之 ItemCollection 所以是唯讀,是因為它處於 ItemsSource 模式中,或是 DeferRefresh 正在生效。

指數超出範圍。

備註

當項目從集合中移除時,索引較高的剩餘項目會減少一,因為集合大小會縮小。

適用於