Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

A Combobox with bitmaps

0.00/5 (No votes)
24 Nov 1999 1  
A combo box that can be used to display bitmaps

Sample Image

This control was made after the useful Icon Picker Combo Box by Joel Wahlberg.

Usage

  1. Include CBitmapPickerCombo.cpp and CBitmapPickerCombo.h in your project
  2. In the resource editor, create a regular combobox with at least the following styles: DropList, OwnerDraw Variable, Has Strings
  3. Create a control member variable for the combobox in VC's classwizard
  4. Replace CComboBox with CBitmapPickerCombo in your dialog's .h file
  5. In OnInitDialog, use the AddBitmap or InsertBitmap member functions to add CBitmaps (and optional strings) to the combobox

The height of the combobox is automatically set to the highest bitmap.

Relevant Member Function Prototypes

int CBitmapPickerCombo::AddBitmap(const CBitmap *bitmap, const char *string = NULL);
int CBitmapPickerCombo::InsertBitmap
    (int nIndex, const CBitmap *bitmap, const char *string = NULL);

License

This article has no explicit license attached to it, but may contain usage terms in the article text or the download files themselves. If in doubt, please contact the author via the discussion board below. A list of licenses authors might use can be found here.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here