Visual Basic: Windows Controls

Visual Studio 6.0

ComboItem Object

See Also    Example    Properties    Methods    Events

A ComboItem object is an item in the list portion of an ImageCombo control. ComboItem objects can display text and/or pictures, and they can appear indented from other items in the list.

Syntax

object.ComboItem

The ComboItem object syntax has these parts:

Part Description
object An object expression that evaluates to an ImageCombo control.

Remarks

The ComboItem object and its corresponding ComboItems collection contain all the items that appear in the list portion of the ImageCombo control. Because list items are stored in a collection, each item can have multiple properties associated with it. This makes the task of assigning and managing the images associated with list items much easier.

Because the items in the list are objects in a collection, certain properties found in the standard combo box (such as List, ListIndex, and ItemData) are no longer required.

With a ComboItem object you can:

  • Specify the text of an item.

  • Assign a picture to be displayed next to the item by specifying an index into an ImageList control.

  • Specify a different image for the item when it is selected from the list.

  • Specify an indentation for an item.

  • Assign the item a unique Key value that can be used to refer to it instead of its index in the collection.

The ImageCombo control does not initially contain any ComboItem objects. You must add using the Add method.

Show: