Visual C++ and MFC Programming 2nd Edition

(Martin Jones) #1

Visual C++ and MFC Fundamentals Chapter 20: List-Based Controls


To use this type of combo box, the user would click the down
pointing arrow button. This causes a list of items to display. If the
user finds the desired item in the list, he or she can click it. The item
clicked becomes the selection and it gets in the edit box side of the
combo box:

If the user does not find the desired item, he or she can click the down pointing arrow. In
this case, no selection is made and the combo box remains as it was before the button was
clicked, whether it had an item or not.

A combo box is called “Drop Down” or Drop List if
it is made of an edit box and a down pointing arrow,
as described above. Another type of combo box is
referred to as Simple. This kind displays its items
like a list box. The user does not have to click an
arrow button to display the list. When a simple
combo box displays, the user can locate the desired
item in the list and click it. The selected item
becomes the value of the edit side.

Like a list box or a group of radio buttons, a combo box is used to display a list of items
to the user to select from. Like a series of radio buttons, a combo box allows the user to
select only one item from the list. Like the list box control, if the number of items is
higher than the allocated space can accommodate, the combo box is equipped with a
vertical scroll bar, whether it is a drop type or a simple kind:

Over a list box, a combo box (especially the drop kinds) has the advantage of saving
space as it can use only as much space as a combination of an edit box and a small
button.

Practical Learning: Introduction to Combo Boxes



  1. Start a new MFC Application and name it Clarksville Ice Scream2

  2. Create it as a Dialog Based without the About Box. Set the Dialog Title to
    Clarksville Ice Scream

  3. Click Finish

Free download pdf