ListView.ListViewItemCollection.IList.Insert(Int32, Object) ListView.ListViewItemCollection.IList.Insert(Int32, Object) ListView.ListViewItemCollection.IList.Insert(Int32, Object) Method

定义

将对象插入到集合中的指定索引处。Inserts an object into the collection at the specified index.

 virtual void System.Collections.IList.Insert(int index, System::Object ^ item) = System::Collections::IList::Insert;
void IList.Insert (int index, object item);
Sub Insert (index As Integer, item As Object) Implements IList.Insert

参数

index
Int32 Int32 Int32

插入项的从零开始的索引位置。The zero-based index location where the item is inserted.

item
Object Object Object

表示要插入的项的对象。The object that represents the item to insert.

实现

异常

索引参数小于零或大于 CountListView.ListViewItemCollection 属性的值。The index parameter is less than 0 or greater than the value of the Count property of the ListView.ListViewItemCollection.

注解

item参数可以是任何类型。The item parameter can be any type. 如果item ListView.ListViewItemCollection是,则会将其添加到中。ListViewItemIf item is a ListViewItem, it is added to the ListView.ListViewItemCollection. 如果item是另一种类型, ListViewItem则将创建一个新的, ToString其中包含item的方法中的字符串。If item is another type, a new ListViewItem is created containing the string from the ToString method of item.

适用于