Type | Description | |||
Value as Long | A long expression that indicates the item's value. | |||
Caption as String | A string expression that indicates the item's caption. The Caption property supports built-in HTML format. | |||
Image as Variant | A long expression that indicates the index of the icon being displayed in the item. |
The AddItem method adds new items for editors of the following type: DropDown, DropDownList, CheckList and PickEdit. Use the EditType property to change the editor's type. Adding an item with the same value removes the old one and add the new one. So, please make sure that you are using different values. If the editor's type is CheckList the Value property is a bit combination of checked items in the drop down list. If the editor's type is DropDowList or PickEdit the editor's value is the item's value. If the editor's type is DropDown, the editor's Value is the item's caption. Use the RemoveItem method to remove an item from the editor's predefined list. Use the ClearItems method to clear the entire list of predefined items. Use the Refresh method to refresh the control. Use the FindItem property to get the caption of the item's value. The ItemCount property counts the number of items in the control's predefined list. The ItemCaption property gives the caption of an item giving its index. Use the SortItems method to sort the list of items.
The Caption parameter supports built-in HTML format like follows:
Also, newer HTML format supports decorative text like follows:
or "<font ;31><sha 404040;5;0><fgcolor=FFFFFF>outline anti-aliasing</fgcolor></sha></font>" gets:
The following sample shows how to combine the value for a CheckList type editor:
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 End With