ListView.CheckedListViewItemCollection 类
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
表示在列表视图控件中已选中项的集合。
public: ref class ListView::CheckedListViewItemCollection : System::Collections::IList
public class ListView.CheckedListViewItemCollection : System.Collections.IList
[System.ComponentModel.ListBindable(false)]
public class ListView.CheckedListViewItemCollection : System.Collections.IList
type ListView.CheckedListViewItemCollection = class
interface IList
interface ICollection
interface IEnumerable
[<System.ComponentModel.ListBindable(false)>]
type ListView.CheckedListViewItemCollection = class
interface IList
interface ICollection
interface IEnumerable
Public Class ListView.CheckedListViewItemCollection
Implements IList
- 继承
-
ListView.CheckedListViewItemCollection
- 属性
- 实现
将 ListView.CheckedListViewItemCollection 选中的项存储在 控件中 ListView 。 仅当控件的 属性设置为 true
时CheckBoxes,ListView才能检查项。 中 ListView.CheckedListViewItemCollection 存储的项是 中包含的 ListView.ListViewItemCollection项。 类 ListView.ListViewItemCollection 存储控件中显示的 ListView 所有项。
下表显示了 如何在 ListView.ListViewItemCollection 示例控件中存储 的 ListView 项及其选择状态的示例 ListView 。
索引 | Item | ListView 中的选中状态 |
---|---|---|
0 | Item1 | 未选中 |
1 | Item2 | 已选中 |
2 | Item3 | 未选中 |
3 | Item4 | 已选中 |
4 | Item5 | 已选中 |
根据上 ListView.ListViewItemCollection 表中的示例,下表演示了 的显示方式 ListView.CheckedListViewItemCollection 。
索引 | ListViewItemCollection 中的选中项 |
---|---|
0 | Item2 |
1 | Item4 |
2 | Item5 |
可以使用此类的属性和方法通过 集合执行各种任务。 使用 Contains 方法可以确定 类中的 ListView.ListViewItemCollection 项是否为 的成员 ListView.CheckedListViewItemCollection。 知道项在集合中后,可以使用 IndexOf 方法确定项在 中 ListView.CheckedListViewItemCollection的位置。
Count |
获取集合中的项数。 |
Is |
获取一个值,该值指示集合是否为只读。 |
Item[Int32] |
获取集合中指定索引处的项。 |
Item[String] |
从集合中获取具有指定键的项。 |
Contains(List |
确定指定项是否位于集合内。 |
Contains |
确定具有指定键的列是否包含在集合中。 |
Copy |
将整个集合复制到现有数组中,从该数组内的指定位置开始复制。 |
Equals(Object) |
确定指定对象是否等于当前对象。 (继承自 Object) |
Get |
返回一个可用于循环访问选定的项集合的枚举数。 |
Get |
作为默认哈希函数。 (继承自 Object) |
Get |
获取当前实例的 Type。 (继承自 Object) |
Index |
返回指定的项在集合中的索引。 |
Index |
确定具有指定键的项的索引。 |
Memberwise |
创建当前 Object 的浅表副本。 (继承自 Object) |
To |
返回表示当前对象的字符串。 (继承自 Object) |
ICollection. |
获取一个值,该值指示是否同步对 ListView.CheckedListViewItemCollection 的访问(线程安全)。 |
ICollection. |
获取可用于同步控件集合访问的对象。 |
IList. |
向集合中添加一项。 |
IList. |
从集合中移除所有项。 |
IList. |
验证该项是否已选中。 |
IList. |
返回指定的项在集合中的索引。 |
IList. |
将某个项插入到集合中的指定索引处。 |
IList. |
获取一个值,该值指示集合是否具有固定大小。 |
IList. |
从集合中获取或设置对象。 |
IList. |
从集合中移除某项的第一个匹配项。 |
IList. |
从集合中移除位于指定索引处的项。 |
Cast<TResult>(IEnumerable) |
将 IEnumerable 的元素强制转换为指定的类型。 |
Of |
根据指定类型筛选 IEnumerable 的元素。 |
As |
启用查询的并行化。 |
As |
将 IEnumerable 转换为 IQueryable。 |
产品 | 版本 |
---|---|
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9, 10 |