Combo Box control

A ComboBox control is similar to a ListBox control (described later, 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.

ComboBox Controls

| June t |

2005 ▼]


2004 ^



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

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

i ColumnCount: The number of columns in the list.

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

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

i ListStyle: The appearance of the list items.

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

i 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.

i 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 provided in Chapter 18.

Was this article helpful?

0 0

Post a comment