CheckedListBox
Namespace: Wisej.Web
Assembly: Wisej.Framework (3.5.0.0)
Displays a ListBox in which a check box is displayed to the left of each item.
- C#
- VB.NET
public class CheckedListBox : ListBox
Public Class CheckedListBox
Inherits ListBox
Constructors
CheckedListBox()
Initializes a new instance of the CheckedListBox class.
CheckedListBox(onItemCheck)
Initializes a new instance of the CheckedListBox class.
| Name | Type | Description |
|---|---|---|
| onItemCheck | Action<Object, ItemCheckEventArgs> | Optional ItemCheck handler. |
CheckedListBox(dataSource, displayMember, valueMember, iconMember, checkStateMember, onItemCheck)
Initializes a new instance of CheckedListBox class with the specified settings.
| Name | Type | Description |
|---|---|---|
| dataSource | Object | Initial DataSource. |
| displayMember | String | Initial DisplayMember. |
| valueMember | String | Initial ValueMember. |
| iconMember | String | Initial IconMember. |
| checkStateMember | String | Initial CheckStateMember. |
| onItemCheck | Action<Object, ItemCheckEventArgs> | Optional ItemCheck handler. |
CheckedListBox(location, size, onItemCheck)
Initializes a new instance of the CheckedListBox class with the specified settings.
| Name | Type | Description |
|---|---|---|
| location | Point | Initial location. |
| size | Size | Initial size. |
| onItemCheck | Action<Object, ItemCheckEventArgs> | Optional ItemCheck handler. |
CheckedListBox(location, size, dataSource, displayMember, valueMember, iconMember, checkStateMember, onItemCheck)
Initializes a new instance of the CheckedListBox class with the specified settings.
| Name | Type | Description |
|---|---|---|
| location | Point | Initial location. |
| size | Size | Initial size. |
| dataSource | Object | Initial DataSource. |
| displayMember | String | Initial DisplayMember. |
| valueMember | String | Initial ValueMember. |
| iconMember | String | Initial IconMember. |
| checkStateMember | String | Initial CheckStateMember. |
| onItemCheck | Action<Object, ItemCheckEventArgs> | Optional ItemCheck handler. |
Properties
CheckedIndices
CheckedIndexCollection: Collection of checked indexes in the CheckedListBox.
CheckedItems
CheckedObjectCollection: Collection of checked items in the CheckedListBox.
CheckOnClick
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)
CheckStateMember
String: Returns or sets the property to bind to the CheckState of the items in the CheckedListBox control. (Default: "")
Items
ObjectCollection: Returns the collection of items in this CheckedListBox.
Methods
ClearChecked()
Unchecks all items in the CheckedListBox.
GetItemChecked(index)
Returns a value indicating whether the specified item is checked.
| Parameter | Type | Description |
|---|---|---|
| index | Int32 | The index of the item. |
Returns: Boolean. true if the item is checked; otherwise, false.
Throws:
- 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.
GetItemCheckState(index)
Returns a value indicating the check state of the current item.
| Parameter | Type | Description |
|---|---|---|
| index | Int32 | The index of the item to get the checked value of. |
Returns: CheckState. One of the CheckState values.
Throws:
- 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.
SetItemChecked(index, value)
Sets CheckState for the item at the specified index to Checked.
| Parameter | Type | Description |
|---|---|---|
| index | Int32 | The index of the item to set the check state for. |
| value | Boolean | true to set the item as checked; otherwise, false. |
Throws:
- ArgumentException The index specified is less than zero; or the index is greater than the count of items in the list.
SetItemCheckState(index, value)
Sets the check state of the item at the specified index.
| Parameter | Type | Description |
|---|---|---|
| index | Int32 | The index of the item to set the state for. |
| value | CheckState | One of the CheckState values. |
Throws:
- 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
AfterItemCheck
ItemCheckEventHandler Fired after the checked state of an item changes.
CheckStateMemberChanged
EventHandler Fired when the CheckStateMember property changes.
Click
EventHandler Fired when the user clicks the CheckedListBox control.
ItemCheck
ItemCheckEventHandler Fired when the checked state of an item changes.
MouseClick
MouseEventHandler Fired when the user clicks the CheckedListBox control with the mouse.
Implements
| Name | Description |
|---|---|
| IBindableComponent | Bindable components implement this interface. |
| IDropTarget | Controls that support drag & drop operations implement this interface. |
| ILabel | Provides access to the LabelWrapper associated with the controls that implement this interface. |
| IReadOnly | Provides access to the ReadOnly property for coontrols that support the read-only mode. |
| IModified | Provides access to the Modified property and ModifiedChanged event for controls that implement this interface. |
| IValidation | Provides access to the validation events and properties property for controls that support validation. |
| IWisejComponent | All wisej components implement this interface. |
| IWisejControl | All wisej controls derived from the Control class must implement this interface. |
| IWisejSerializable | Allows an object to serialize itself. |