ListView.CheckedIndices 属性

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

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

语法

声明
Public ReadOnly Property CheckedIndices As CheckedIndexCollection
用法
Dim instance As ListView
Dim value As CheckedIndexCollection

value = instance.CheckedIndices
public CheckedIndexCollection CheckedIndices { get; }
public:
property CheckedIndexCollection^ CheckedIndices {
    CheckedIndexCollection^ get ();
}
/** @property */
public CheckedIndexCollection get_CheckedIndices ()
public function get CheckedIndices () : CheckedIndexCollection

属性值

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

备注

该属性仅当 ListView 控件的 CheckBoxes 属性设置为 true 时才有用。CheckedIndices 属性返回一个集合,该集合包含控件中所有选中项在 ListView.ListViewItemCollection 中的索引位置。有关如何操作该集合中的项的更多信息,请参见 ListView.CheckedIndexCollection

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

平台

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

请参见

参考

ListView 类
ListView 成员
System.Windows.Forms 命名空间
ListView.CheckedIndexCollection
CheckedItems