ListView.ListViewItemCollection.GetEnumerator 方法

定义

返回一个枚举数,将使用该枚举数循环访问项集合。Returns an enumerator to use to iterate through the item collection.

public:
 virtual System::Collections::IEnumerator ^ GetEnumerator();
public System.Collections.IEnumerator GetEnumerator ();
abstract member GetEnumerator : unit -> System.Collections.IEnumerator
override this.GetEnumerator : unit -> System.Collections.IEnumerator
Public Function GetEnumerator () As IEnumerator

返回

IEnumerator

IEnumerator,表示项集合。An IEnumerator that represents the item collection.

实现

例外

所有者 ListView 处于虚拟模式下。The owner ListView is in virtual mode.

注解

当所有者处于 ListView 虚拟模式时,你无法 ListView.ListViewItemCollection 使用枚举器或调用来枚举 GetEnumeratorWhen the owner ListView is in virtual mode, you cannot enumerate through the ListView.ListViewItemCollection using an enumerator or call GetEnumerator. 而是使用 ListView.Items 属性按索引值访问项。Instead, use the ListView.Items property to access an item by index value.

适用于