Combo Box Controls
A ComboBox control combines the features of a TextBox
control and a ListBox control. The users can enter
information in the text box portion or select an item
from the list box portion of the control. The combo
box control comes in the following three flavours:
- The drop-down list combo
box: The drop-down list combo box always
takes a single line on the form until the user opens
the list to display its values.
- The simple combo box:
It looks and operates like a simple list box with
an attached text box. Users can add values to a
simple combo box by entering them in the control's
attached text box.
- The drop-down combo box:
The drop-down combo box saves screen space by remaining
closed, looking like a one line list box. When the
user selects the control, the drop-down combo box
opens to display a list of items.
|
All combo box controls are similar
to the list box in the way you initialize and
access them from your code. Their primary difference
lie in the way they appear on the screen. |
When you place a combo box control on the form, you
must tell VB, which combo box you want to use, through
the combo box's style
property. The default value for the style
property is 0 - Dropdown
combo.
The following figure shows a combo box
Figure 12.2
|
Use drop-down combo boxes when
you need to offer a list of choices but also want
to save room on the form. |
|