ListView.ListViewItemCollection.RemoveAt 方法

移除集合中指定索引处的项。

**命名空间:**System.Windows.Forms
**程序集:**System.Windows.Forms(在 system.windows.forms.dll 中)

语法

声明
Public Overridable Sub RemoveAt ( _
    index As Integer _
)
用法
Dim instance As ListViewItemCollection
Dim index As Integer

instance.RemoveAt(index)
public virtual void RemoveAt (
    int index
)
public:
virtual void RemoveAt (
    int index
)
public void RemoveAt (
    int index
)
public function RemoveAt (
    index : int
)

参数

  • index
    从零开始的索引(属于要移除的项)。

异常

异常类型 条件

ArgumentOutOfRangeException

index 参数小于零或大于等于 ListView.ListViewItemCollectionCount 属性的值。

备注

当从集合中移除一项时,集合中后面的项的索引将更改。有关移除的项的所有信息均会被删除。您可以使用此方法通过指定要从集合中移除的项的索引来从集合中移除特定项。要指定要移除的项而不是该项的索引,请使用 Remove 方法。若要从集合中移除所有项,请使用 Clear 方法。

平台

Windows 98、Windows 2000 SP4、Windows CE、Windows Millennium Edition、Windows Mobile for Pocket PC、Windows Mobile for Smartphone、Windows Server 2003、Windows XP Media Center Edition、Windows XP Professional x64 Edition、Windows XP SP2、Windows XP Starter Edition

.NET Framework 并不是对每个平台的所有版本都提供支持。有关受支持版本的列表,请参见系统要求

版本信息

.NET Framework

受以下版本支持:2.0、1.1、1.0

.NET Compact Framework

受以下版本支持:2.0、1.0

请参见

参考

ListView.ListViewItemCollection 类
ListView.ListViewItemCollection 成员
System.Windows.Forms 命名空间
Remove
Clear