ListView.ListViewItemCollection.RemoveAt(Int32) Method


删除集合中指定索引处的项。Removes the item at the specified index within the collection.

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



要删除的项的从零开始的索引。The zero-based index of the item to remove.



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


从集合中移除项时,集合中的后续项的索引会发生更改。When you remove an item from the collection, the indexes change for subsequent items in the collection. 删除的项的所有信息都将被删除。All information about the removed item is deleted. 您可以使用此方法,通过指定要从集合中移除的项的索引来从集合中移除特定项。You can use this method to remove a specific item from the collection by specifying the index of the item to remove from the collection. 若要指定要删除的项而不是项的索引,请使用 Remove 方法。To specify the item to remove instead of the index to the item, use the Remove method. 若要从集合中删除所有项,请使用 Clear 方法。To remove all items from the collection, use the Clear method.

Applies to

See also