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 模式。

索引超出範圍。

備註

指定位置之後的所有專案都會向下移動一個專案。

適用於