Type | Description | |||
Value as Variant | A long expression that indicates the value of the item being searched, a string expression that indicates the caption of the item being searched. | |||
Variant | A long value that indicates the value of the item giving its caption, or a string expression that indicates the caption of the item giving its value. |
The FindItem property searches for an item in the control's predefined list. Use the AddItem method to add new entries to the control's predefined list. Use the Value property to get the control's value. The ItemCount property counts the number of items in the control's predefined list.
The following sample displays the value of the item "CanShare":
Private Sub Form_Load() With Editor1 .AddItem 1, "CanLink", 1 .AddItem 2, "CanShare", 2 .AddItem 4, "CanMove", 3 .AddItem 8, "CanRe store", 4 .EditType = EXEDITORSLibCtl.CheckList .Value = 1 + 4 ' CanLink + CanMove Debug.Print .FindItem("CanShare") End With End Sub
The sample displays 2 as a result.
The following sample displays the caption of the item with the 2 value:
Private Sub Form_Load() With Editor1 .AddItem 1, "CanLink", 1 .AddItem 2, "CanShare", 2 .AddItem 4, "CanMove", 3 .AddItem 8, "CanRe store", 4 .EditType = EXEDITORSLibCtl.CheckList .Value = 1 + 4 ' CanLink + CanMove Debug.Print .FindItem(2) End With End Sub
The sample displays "CanShare" as a
result.