ListView.CheckedIndices 属性

定义

获取控件中当前选中项的索引。

C#
[System.ComponentModel.Browsable(false)]
public System.Windows.Forms.ListView.CheckedIndexCollection CheckedIndices { get; }

属性值

ListView.CheckedIndexCollection

ListView.CheckedIndexCollection,包含当前选中项的索引。 如果当前未选中任何项,则返回空的 ListView.CheckedIndexCollection

属性

注解

仅当 CheckBoxes 控件的属性 ListView 设置为 true.. 该 CheckedIndices 属性返回一个集合,该集合包含控件中 ListView.ListViewItemCollection 签入的所有项的索引位置。 有关如何操作集合中的项的详细信息,请参阅 ListView.CheckedIndexCollection

如果要获取控件中 ListView 已签入的项的集合,请使用该 CheckedItems 属性,而不是选中的项的索引位置。

适用于

产品 版本
.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
Windows Desktop 3.0, 3.1, 5, 6, 7

另请参阅