Share via


CheckedListBox.CheckedItemCollection.IndexOf 方法

返回选中项集合中的一个索引。

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

语法

声明
Public Function IndexOf ( _
    item As Object _
) As Integer
用法
Dim instance As CheckedItemCollection
Dim item As Object
Dim returnValue As Integer

returnValue = instance.IndexOf(item)
public int IndexOf (
    Object item
)
public:
virtual int IndexOf (
    Object^ item
) sealed
public final int IndexOf (
    Object item
)
public final function IndexOf (
    item : Object
) : int

参数

  • item
    要检索其索引的对象。该对象必须属于选中项集合。

返回值

该对象在选中项集合中的索引,或者,如果该对象不在该集合中,则为 -1。有关更多信息,请参见 CheckedListBox.CheckedItemCollection 类概述中的示例。

备注

CheckedItems 集合是 Items 集合中对象的子集,仅表示选中的项。此集合按升序排序。

平台

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

请参见

参考

CheckedListBox.CheckedItemCollection 类
CheckedListBox.CheckedItemCollection 成员
System.Windows.Forms 命名空间
Item