# CheckedListBox

Namespace: **Wisej.Web**

Assembly: **Wisej.Framework** (3.5.0.0)

* [Control](https://docs.wisej.com/api/v3.5/wisej.web/general/control)
  * [ListControl](https://docs.wisej.com/api/v3.5/wisej.web/lists-and-grids/listcontrol)
    * [ListBox](https://docs.wisej.com/api/v3.5/wisej.web/lists-and-grids/listbox)
      * [CheckedListBox](https://docs.wisej.com/api/v3.5/wisej.web/lists-and-grids/checkedlistbox)

Displays a [ListBox](https://docs.wisej.com/api/v3.5/wisej.web/lists-and-grids/listbox) in which a check box is displayed to the left of each item.

{% tabs %}
{% tab title="C#" %}

```csharp
public class CheckedListBox : ListBox
```

{% endtab %}

{% tab title="VB.NET" %}

```visual-basic
Public Class CheckedListBox
    Inherits ListBox
```

{% endtab %}
{% endtabs %}

## Constructors

### ![](https://2194374196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVxzkjZGSCpOtYHlmOePS%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)CheckedListBox()

Initializes a new instance of the [CheckedListBox](https://docs.wisej.com/api/v3.5/wisej.web/lists-and-grids/checkedlistbox) class.

### ![](https://2194374196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVxzkjZGSCpOtYHlmOePS%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)CheckedListBox(onItemCheck)

Initializes a new instance of the [CheckedListBox](https://docs.wisej.com/api/v3.5/wisej.web/lists-and-grids/checkedlistbox) class.

| Name            | Type                                                                                         | Description                               |
| --------------- | -------------------------------------------------------------------------------------------- | ----------------------------------------- |
| **onItemCheck** | [Action\<Object, ItemCheckEventArgs>](https://docs.microsoft.com/dotnet/api/system.action-2) | Optional [ItemCheck](#itemcheck) handler. |

### ![](https://2194374196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVxzkjZGSCpOtYHlmOePS%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)CheckedListBox(dataSource, displayMember, valueMember, iconMember, checkStateMember, onItemCheck)

Initializes a new instance of [CheckedListBox](https://docs.wisej.com/api/v3.5/wisej.web/lists-and-grids/checkedlistbox) class with the specified settings.

| Name                 | Type                                                                                         | Description                                                                                   |
| -------------------- | -------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
| **dataSource**       | [Object](https://docs.microsoft.com/dotnet/api/system.object)                                | Initial [DataSource](https://docs.wisej.com/api/v3.5/wisej.web/listcontrol#datasource).       |
| **displayMember**    | [String](https://docs.microsoft.com/dotnet/api/system.string)                                | Initial [DisplayMember](https://docs.wisej.com/api/v3.5/wisej.web/listcontrol#displaymember). |
| **valueMember**      | [String](https://docs.microsoft.com/dotnet/api/system.string)                                | Initial [ValueMember](https://docs.wisej.com/api/v3.5/wisej.web/listcontrol#valuemember).     |
| **iconMember**       | [String](https://docs.microsoft.com/dotnet/api/system.string)                                | Initial [IconMember](https://docs.wisej.com/api/v3.5/wisej.web/listcontrol#iconmember).       |
| **checkStateMember** | [String](https://docs.microsoft.com/dotnet/api/system.string)                                | Initial [CheckStateMember](#checkstatemember).                                                |
| **onItemCheck**      | [Action\<Object, ItemCheckEventArgs>](https://docs.microsoft.com/dotnet/api/system.action-2) | Optional [ItemCheck](#itemcheck) handler.                                                     |

### ![](https://2194374196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVxzkjZGSCpOtYHlmOePS%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)CheckedListBox(location, size, onItemCheck)

Initializes a new instance of the [CheckedListBox](https://docs.wisej.com/api/v3.5/wisej.web/lists-and-grids/checkedlistbox) class with the specified settings.

| Name            | Type                                                                                         | Description                               |
| --------------- | -------------------------------------------------------------------------------------------- | ----------------------------------------- |
| **location**    | [Point](https://docs.microsoft.com/dotnet/api/system.drawing.point)                          | Initial location.                         |
| **size**        | [Size](https://docs.microsoft.com/dotnet/api/system.drawing.size)                            | Initial size.                             |
| **onItemCheck** | [Action\<Object, ItemCheckEventArgs>](https://docs.microsoft.com/dotnet/api/system.action-2) | Optional [ItemCheck](#itemcheck) handler. |

### ![](https://2194374196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVxzkjZGSCpOtYHlmOePS%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)CheckedListBox(location, size, dataSource, displayMember, valueMember, iconMember, checkStateMember, onItemCheck)

Initializes a new instance of the [CheckedListBox](https://docs.wisej.com/api/v3.5/wisej.web/lists-and-grids/checkedlistbox) class with the specified settings.

| Name                 | Type                                                                                         | Description                                                                                   |
| -------------------- | -------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
| **location**         | [Point](https://docs.microsoft.com/dotnet/api/system.drawing.point)                          | Initial location.                                                                             |
| **size**             | [Size](https://docs.microsoft.com/dotnet/api/system.drawing.size)                            | Initial size.                                                                                 |
| **dataSource**       | [Object](https://docs.microsoft.com/dotnet/api/system.object)                                | Initial [DataSource](https://docs.wisej.com/api/v3.5/wisej.web/listcontrol#datasource).       |
| **displayMember**    | [String](https://docs.microsoft.com/dotnet/api/system.string)                                | Initial [DisplayMember](https://docs.wisej.com/api/v3.5/wisej.web/listcontrol#displaymember). |
| **valueMember**      | [String](https://docs.microsoft.com/dotnet/api/system.string)                                | Initial [ValueMember](https://docs.wisej.com/api/v3.5/wisej.web/listcontrol#valuemember).     |
| **iconMember**       | [String](https://docs.microsoft.com/dotnet/api/system.string)                                | Initial [IconMember](https://docs.wisej.com/api/v3.5/wisej.web/listcontrol#iconmember).       |
| **checkStateMember** | [String](https://docs.microsoft.com/dotnet/api/system.string)                                | Initial [CheckStateMember](#checkstatemember).                                                |
| **onItemCheck**      | [Action\<Object, ItemCheckEventArgs>](https://docs.microsoft.com/dotnet/api/system.action-2) | Optional [ItemCheck](#itemcheck) handler.                                                     |

## Properties

### ![](https://2194374196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVxzkjZGSCpOtYHlmOePS%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)CheckedIndices

[CheckedIndexCollection](https://docs.wisej.com/api/v3.5/wisej.web/lists-and-grids/checkedlistbox/wisej.web.checkedlistbox.checkedindexcollection): Collection of checked indexes in the [CheckedListBox](https://docs.wisej.com/api/v3.5/wisej.web/lists-and-grids/checkedlistbox).

### ![](https://2194374196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVxzkjZGSCpOtYHlmOePS%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)CheckedItems

[CheckedObjectCollection](https://docs.wisej.com/api/v3.5/wisej.web/lists-and-grids/checkedlistbox/wisej.web.checkedlistbox.checkedobjectcollection): Collection of checked items in the [CheckedListBox](https://docs.wisej.com/api/v3.5/wisej.web/lists-and-grids/checkedlistbox).

### ![](https://2194374196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVxzkjZGSCpOtYHlmOePS%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)CheckOnClick

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns or sets whether list items are checked when they are clicked. The default is to check the item when clicking on the checkbox icon. (Default: `False`)

### ![](https://2194374196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVxzkjZGSCpOtYHlmOePS%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)CheckStateMember

[String](https://docs.microsoft.com/dotnet/api/system.string): Returns or sets the property to bind to the [CheckState](https://docs.wisej.com/api/v3.5/wisej.web/enumerations/wisej.web.checkstate) of the items in the [CheckedListBox](https://docs.wisej.com/api/v3.5/wisej.web/lists-and-grids/checkedlistbox) control. (Default: `""`)

### ![](https://2194374196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVxzkjZGSCpOtYHlmOePS%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)Items

[ObjectCollection](https://docs.wisej.com/api/v3.5/wisej.web/lists-and-grids/checkedlistbox/wisej.web.checkedlistbox.objectcollection): Returns the collection of items in this [CheckedListBox](https://docs.wisej.com/api/v3.5/wisej.web/lists-and-grids/checkedlistbox).

## Methods

### ![](https://2194374196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVxzkjZGSCpOtYHlmOePS%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)ClearChecked()

Unchecks all items in the [CheckedListBox](https://docs.wisej.com/api/v3.5/wisej.web/lists-and-grids/checkedlistbox).

### ![](https://2194374196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVxzkjZGSCpOtYHlmOePS%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)GetItemChecked(index)

Returns a value indicating whether the specified item is checked.

| Parameter | Type                                                        | Description            |
| --------- | ----------------------------------------------------------- | ---------------------- |
| **index** | [Int32](https://docs.microsoft.com/dotnet/api/system.int32) | The index of the item. |

**Returns:** [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean). true if the item is checked; otherwise, false.

**Throws:**

* [ArgumentException](https://docs.microsoft.com/dotnet/api/system.argumentexception) The *index* specified is less than zero; or the *index* specified is greater than or equal to the count of items in the list.

### ![](https://2194374196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVxzkjZGSCpOtYHlmOePS%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)GetItemCheckState(index)

Returns a value indicating the check state of the current item.

| Parameter | Type                                                        | Description                                        |
| --------- | ----------------------------------------------------------- | -------------------------------------------------- |
| **index** | [Int32](https://docs.microsoft.com/dotnet/api/system.int32) | The index of the item to get the checked value of. |

**Returns:** [CheckState](https://docs.wisej.com/api/v3.5/wisej.web/enumerations/wisej.web.checkstate). One of the [CheckState](https://docs.wisej.com/api/v3.5/wisej.web/enumerations/wisej.web.checkstate) values.

**Throws:**

* [ArgumentOutOfRangeException](https://docs.microsoft.com/dotnet/api/system.argumentoutofrangeexception) The *index* specified is less than zero; or the *index* specified is greater than or equal to the count of items in the list.

### ![](https://2194374196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVxzkjZGSCpOtYHlmOePS%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)SetItemChecked(index, value)

Sets [CheckState](https://docs.wisej.com/api/v3.5/wisej.web/enumerations/wisej.web.checkstate) for the item at the specified index to Checked.

| Parameter | Type                                                            | Description                                        |
| --------- | --------------------------------------------------------------- | -------------------------------------------------- |
| **index** | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)     | The index of the item to set the check state for.  |
| **value** | [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean) | true to set the item as checked; otherwise, false. |

**Throws:**

* [ArgumentException](https://docs.microsoft.com/dotnet/api/system.argumentexception) The index specified is less than zero; or the index is greater than the count of items in the list.

### ![](https://2194374196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVxzkjZGSCpOtYHlmOePS%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)SetItemCheckState(index, value)

Sets the check state of the item at the specified index.

| Parameter | Type                                                                                      | Description                                                                                                  |
| --------- | ----------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
| **index** | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                               | The index of the item to set the state for.                                                                  |
| **value** | [CheckState](https://docs.wisej.com/api/v3.5/wisej.web/enumerations/wisej.web.checkstate) | One of the [CheckState](https://docs.wisej.com/api/v3.5/wisej.web/enumerations/wisej.web.checkstate) values. |

**Throws:**

* [ArgumentOutOfRangeException](https://docs.microsoft.com/dotnet/api/system.argumentoutofrangeexception) The *index* specified is less than zero; or the *index* is greater than or equal to the count of items in the list.

## Events

### ![](https://2194374196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVxzkjZGSCpOtYHlmOePS%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)AfterItemCheck

[ItemCheckEventHandler](https://docs.wisej.com/api/v3.5/wisej.web/lists-and-grids/checkedlistbox/wisej.web.itemcheckeventhandler) Fired after the checked state of an item changes.

### ![](https://2194374196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVxzkjZGSCpOtYHlmOePS%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)CheckStateMemberChanged

[EventHandler](https://docs.microsoft.com/dotnet/api/system.eventhandler) Fired when the [CheckStateMember](#checkstatemember) property changes.

### ![](https://2194374196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVxzkjZGSCpOtYHlmOePS%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)Click

[EventHandler](https://docs.microsoft.com/dotnet/api/system.eventhandler) Fired when the user clicks the [CheckedListBox](https://docs.wisej.com/api/v3.5/wisej.web/lists-and-grids/checkedlistbox) control.

### ![](https://2194374196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVxzkjZGSCpOtYHlmOePS%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)ItemCheck

[ItemCheckEventHandler](https://docs.wisej.com/api/v3.5/wisej.web/lists-and-grids/checkedlistbox/wisej.web.itemcheckeventhandler) Fired when the checked state of an item changes.

### ![](https://2194374196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVxzkjZGSCpOtYHlmOePS%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)MouseClick

[MouseEventHandler](https://docs.wisej.com/api/v3.5/wisej.web/general/control/wisej.web.mouseeventhandler) Fired when the user clicks the [CheckedListBox](https://docs.wisej.com/api/v3.5/wisej.web/lists-and-grids/checkedlistbox) control with the mouse.

## Implements

| Name                                                                                                      | Description                                                                                                                                                                                                                                                                 |
| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [IBindableComponent](https://docs.wisej.com/api/v3.5/wisej.web/data-binding/wisej.web.ibindablecomponent) | Bindable components implement this interface.                                                                                                                                                                                                                               |
| [IDropTarget](https://docs.wisej.com/api/v3.5/wisej.web/interfaces/wisej.web.idroptarget)                 | Controls that support drag & drop operations implement this interface.                                                                                                                                                                                                      |
| [ILabel](https://docs.wisej.com/api/v3.5/wisej.web/interfaces/wisej.web.ilabel)                           | Provides access to the [LabelWrapper](https://docs.wisej.com/api/v3.5/wisej.web/editors/wisej.web.labelwrapper) associated with the controls that implement this interface.                                                                                                 |
| [IReadOnly](https://docs.wisej.com/api/v3.5/wisej.web/interfaces/wisej.web.ireadonly)                     | Provides access to the [ReadOnly](https://docs.wisej.com/api/v3.5/interfaces/wisej.web.ireadonly#readonly) property for coontrols that support the read-only mode.                                                                                                          |
| [IModified](https://docs.wisej.com/api/v3.5/wisej.web/interfaces/wisej.web.imodified)                     | Provides access to the [Modified](https://docs.wisej.com/api/v3.5/interfaces/wisej.web.imodified#modified) property and [ModifiedChanged](https://docs.wisej.com/api/v3.5/interfaces/wisej.web.imodified#modifiedchanged) event for controls that implement this interface. |
| [IValidation](https://docs.wisej.com/api/v3.5/wisej.web/interfaces/wisej.web.ivalidation)                 | Provides access to the validation events and properties property for controls that support validation.                                                                                                                                                                      |
| [IWisejComponent](https://docs.wisej.com/api/v3.5/wisej.core/interfaces/wisej.core.iwisejcomponent)       | All wisej components implement this interface.                                                                                                                                                                                                                              |
| [IWisejControl](https://docs.wisej.com/api/v3.5/wisej.core/interfaces/wisej.core.iwisejcontrol)           | All wisej controls derived from the [Control](https://docs.wisej.com/api/v3.5/wisej.web/general/control) class must implement this interface.                                                                                                                               |
| [IWisejSerializable](https://docs.wisej.com/api/v3.5/wisej.core/interfaces/wisej.core.iwisejserializable) | Allows an object to serialize itself.                                                                                                                                                                                                                                       |
