ListView.ListViewItemCollection.RemoveAt(Int32) ListView.ListViewItemCollection.RemoveAt(Int32) ListView.ListViewItemCollection.RemoveAt(Int32) ListView.ListViewItemCollection.RemoveAt(Int32) Method

定义

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

public:
 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)

参数

index
Int32 Int32 Int32 Int32

要移除的项的从零开始的索引。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.

适用于

另请参阅