Combo Box control

A ComboBox control is similar to a ListBox control (I describe this in this chapter's "ListBox control" section). A ComboBox, however, is a drop-down box and displays only one item at a time. Another difference is that the user may be allowed to enter a value that does not appear in the list of items. Figure 17-6 shows two ComboBox controls.

Figure 17-6:

ComboBox controls.

Figure 17-6:

ComboBox controls.

The following is a description of some useful ComboBox control properties:

1 BoundColumn: If the list contains multiple columns, this property determines which column contains the returned value.

1 ColumnCount: The number of columns in the list.

1 ControlSource: A cell that stores the value selected in the ComboBox.

1 ListRows: The number of items to display when the list drops down.

1 ListStyle: The appearance of the list items.

1 RowSource: A range address that contains the list of items displayed in the ComboBox.

1 Style: Determines whether the control acts like a drop-down list or a combo box. A drop-down list doesn't allow the user to enter a new value.

1 Value: The text of the item selected by the user and displayed in the ComboBox.

If your list of items is not in a worksheet, you can add items to a ComboBox control by using the AddItem method. More information on this method is in Chapter 18.

0 0

Post a comment