語言

ItemCollection.Insert(Int32, Object) 方法

定義

在指定的索引處插入一個元素到集合中。

public:
 virtual void Insert(int insertIndex, System::Object ^ insertItem);
public void Insert(int insertIndex, object insertItem);
abstract member Insert : int * obj -> unit
override this.Insert : int * obj -> unit
Public Sub Insert (insertIndex As Integer, insertItem As Object)

參數

insertIndex
Int32

插入該項目的零基索引。

insertItem
Object

要插入的物品。

實作

例外狀況

這個收藏目前是 ItemsSource 模式。

指數超出範圍。

備註

所有在指定位置之後的項目會往下移動一。

適用於