ListView.ListViewItemCollection.Remove(ListViewItem) ListView.ListViewItemCollection.Remove(ListViewItem) ListView.ListViewItemCollection.Remove(ListViewItem) ListView.ListViewItemCollection.Remove(ListViewItem) Method

定义

从集合中移除指定的项。Removes the specified item from the collection.

public:
 virtual void Remove(System::Windows::Forms::ListViewItem ^ item);
public virtual void Remove (System.Windows.Forms.ListViewItem item);
abstract member Remove : System.Windows.Forms.ListViewItem -> unit
override this.Remove : System.Windows.Forms.ListViewItem -> unit
Public Overridable Sub Remove (item As ListViewItem)

参数

item
ListViewItem ListViewItem ListViewItem ListViewItem

ListViewItem,表示要从集合中移除的项。A ListViewItem representing the item to remove from the collection.

异常

分配给 item 参数的 ListViewItemnullThe ListViewItem assigned to the item parameter is null.

注解

从集合中移除项时,集合中的后续项的索引会发生更改。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 actual item to remove. 若要指定要删除的项的索引而不是项本身,请使用RemoveAt方法。To specify the index of the item to remove instead of the item itself, use the RemoveAt method. 若要从集合中删除所有项,请Clear使用方法。To remove all items from the collection, use the Clear method.

适用于

另请参阅