ListView.SelectedListViewItemCollection.Count 属性

定义

获取集合中的项数。Gets the number of items in the collection.

public:
 property int Count { int get(); };
[System.ComponentModel.Browsable(false)]
public int Count { get; }
[<System.ComponentModel.Browsable(false)>]
member this.Count : int
Public ReadOnly Property Count As Integer

属性值

Int32

集合中项的数目。The number of items in the collection.

实现

属性

注解

此属性使您能够确定控件中选定项的数目 ListViewThis property enables you to determine the number of selected items in the ListView control. 然后,可以在循环遍历集合的值时使用此值,并且需要提供多个迭代来执行循环。You can then use this value when looping through the values of the collection and you need to provide a number of iterations to perform the loop. 除非将 MultiSelect 的属性 ListView 设置为,否则 true 此属性始终返回值为零 (0) 或 (1) ,具体取决于是否具有选定的项。Unless the MultiSelect property of the ListView is set to true, this property always returns a value of zero (0) or one (1) depending on whether you have a selected item.

适用于