Click here to Skip to main content
11,632,260 members (69,970 online)
Click here to Skip to main content

A Combobox with bitmaps

, 24 Nov 1999 169.6K 5K 58
Rate this:
Please Sign up or sign in to vote.
A combo box that can be used to display bitmaps
<!-- STEP 2. Include download and sample image information -->
  • Download demo project - 22 Kb
  • Download source - 4 Kb
  • 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

    <!-- start a block of source code -->
    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

    Share

    About the Author

    Anneke Sicherer-Roetman
    Web Developer
    Netherlands Netherlands
    No Biography provided

    You may also be interested in...

    Comments and Discussions

     
    GeneralStrange behavior on scrolling Pin
    indra2025-Jun-06 21:04
    memberindra2025-Jun-06 21:04 
    GeneralRe: Strange behavior on scrolling Pin
    Michael Gunlock28-Oct-07 18:24
    memberMichael Gunlock28-Oct-07 18:24 
    GeneralDrop down window zero height Pin
    Obliterator10-Jun-05 4:34
    memberObliterator10-Jun-05 4:34 
    GeneralRe: Drop down window zero height Pin
    Anonymous18-Aug-05 6:49
    sussAnonymous18-Aug-05 6:49 
    Questionhow to link data in combo box to dialog box Pin
    jinshi22-Jan-05 19:58
    memberjinshi22-Jan-05 19:58 
    GeneralNIce Pin
    sreejith ss nair11-Dec-04 22:15
    membersreejith ss nair11-Dec-04 22:15 
    GeneralIntergration with MFCGrid Pin
    MHillary23-Jul-04 6:14
    memberMHillary23-Jul-04 6:14 
    QuestionHow to delete bitmap? Pin
    Bruce Hsiao28-Sep-03 23:16
    sussBruce Hsiao28-Sep-03 23:16 
    AnswerRe: How to delete bitmap? Pin
    Myrkron24-Jul-07 8:27
    memberMyrkron24-Jul-07 8:27 
    Generalgood Pin
    lovexinqing30-Mar-03 10:42
    memberlovexinqing30-Mar-03 10:42 
    GeneralRe: good Pin
    KongShan13-May-03 14:57
    memberKongShan13-May-03 14:57 
    GeneralRe: good Pin
    Anonymous17-May-03 13:50
    sussAnonymous17-May-03 13:50 
    GeneralRe: good Pin
    Bin Xiong13-Jun-05 17:55
    memberBin Xiong13-Jun-05 17:55 
    GeneralUnable to place other bitmaps Pin
    Anonymous7-May-01 22:30
    memberAnonymous7-May-01 22:30 
    GeneralRe: Unable to place other bitmaps Pin
    Marron23-Jan-04 10:32
    sussMarron23-Jan-04 10:32 
    GeneralRe: Unable to place other bitmaps Pin
    vadimpl11-May-06 9:16
    membervadimpl11-May-06 9:16 
    QuestionWhy not use CComboBoxEx? Pin
    David Saulnier26-May-00 10:11
    sussDavid Saulnier26-May-00 10:11 
    AnswerRe: Why not use CComboBoxEx? Pin
    Christian Carrillo16-Jun-00 5:18
    sussChristian Carrillo16-Jun-00 5:18 
    AnswerRe: Why not use CComboBoxEx? Pin
    Paul Martinsen28-Feb-02 13:02
    memberPaul Martinsen28-Feb-02 13:02 
    GeneralCombobox on a CDialogBar Pin
    jose manjon1-Mar-00 7:18
    sussjose manjon1-Mar-00 7:18 
    GeneralRe: Combobox on a CDialogBar Pin
    Anonymous11-Jun-01 22:29
    memberAnonymous11-Jun-01 22:29 
    GeneralRe: Combobox on a CDialogBar Pin
    Rémi Morin25-Jul-01 3:11
    memberRémi Morin25-Jul-01 3:11 
    GeneralRe: Combobox on a CDialogBar ;) Pin
    Remi Morin26-Jul-01 3:08
    memberRemi Morin26-Jul-01 3:08 

    General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

    Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

    | Advertise | Privacy | Terms of Use | Mobile
    Web01 | 2.8.150728.1 | Last Updated 25 Nov 1999
    Article Copyright 1999 by Anneke Sicherer-Roetman
    Everything else Copyright © CodeProject, 1999-2015
    Layout: fixed | fluid