CheckedListBox.GetItemChecked 方法

返回指示指定项是否选中的值。

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

语法

声明
Public Function GetItemChecked ( _
    index As Integer _
) As Boolean
用法
Dim instance As CheckedListBox
Dim index As Integer
Dim returnValue As Boolean

returnValue = instance.GetItemChecked(index)
public bool GetItemChecked (
    int index
)
public:
bool GetItemChecked (
    int index
)
public boolean GetItemChecked (
    int index
)
public function GetItemChecked (
    index : int
) : boolean

参数

  • index
    项的索引。

返回值

如果选中该项,则为 true;否则为 false

异常

异常类型 条件

ArgumentException

指定的 index 小于零。

- 或 -

指定的 index 大于或等于列表中项的计数。

备注

如果该项的 CheckState 值是 CheckedIndeterminate,则 GetItemChecked 返回 true。若要确定该项所处的特定状态,请使用 GetItemCheckState 方法。

平台

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 类
CheckedListBox 成员
System.Windows.Forms 命名空间
GetItemCheckState
CheckState