A Combobox with bitmaps






4.75/5 (6 votes)
Nov 25, 1999

336310

6625
A combo box that can be used to display bitmaps
This control was made after the useful Icon Picker Combo Box by Joel Wahlberg.
Usage
- Include CBitmapPickerCombo.cpp and CBitmapPickerCombo.h in your project
- In the resource editor, create a regular
combobox
with at least the following styles:DropList
,OwnerDraw
Variable
, Has Strings - Create a control member variable for the
combobox
in VC's classwizard - Replace
CComboBox
withCBitmapPickerCombo
in your dialog's .h file - In
OnInitDialog
, use theAddBitmap
orInsertBitmap
member functions to addCBitmap
s (and optional strings) to thecombobox
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.