Type | Description | |||
Long | A long expression that indicates the number of items in the control's predefined list. |
The ItemCount property counts the items in the control's predefined list. Use the AddItem method to add new entries to the control's predefined list. Use the RemoveItem property to remove an item from the control's predefined list. Use the FindItem property to look for an item. Use the ItemCaption property to get the caption of the item by specifying its index in the control's predefined list.
The following sample displays the items in the control's predefined list:
Private Sub Form_Load() With Editor1 .AddItem 1, "CanLink", 1 .AddItem 2, "CanShare", 2 .AddItem 4, "CanMove", 3 .AddItem 8, "CanRestore", 3 .EditType = CheckList .Value = 1 + 4 ' CanLink + CanMove For i = 0 To .ItemCount - 1 Debug.Print .ItemCaption(i) Next End With End Sub