Click here to Skip to main content
12,826,806 members (37,539 online)
Click here to Skip to main content
Add your own
alternative version


48 bookmarked
Posted 15 Dec 1999

Office Style Flat ComboBox

, 15 Dec 1999
Rate this:
Please Sign up or sign in to vote.
A drop-in replacement combobox that gives your apps the flat Office-style look
  • Download demo project - 46 Kb
  • Download source files - 7 Kb
  • Sample Image - combobox_flatcombo.gif

    <!-- Article Starts -->

    This control easily gives your application the Flat Look that is seen in the Microsoft office products. To use the control, simply add the files CCJFlatComboBox.cpp and CCJFlatComboBox.h to your project. You can use Class Wizard to add the CCJFlatComboBox member variables ( you most likely will have to rebuild the .clw file associated with your project ), or just replace any instance of CComboBox , with CCJFlatComboBox .


    Below is and example of how you might add the control to your project.

    Header file:

    CCJFlatComboBox m_DDCombo;  

    Implementation file:

    DDX_Control(pDX, IDC_DROPDOWN_COMBO, m_DDCombo);  


    • Chris Maunder - For letting me use his color picker class, and for his auto-completion code. I made some modifications to the appearance of the control that is used in this demo. My modifications are noted.
    • Gilberto Botaro - For his help with adding auto completion to the CCJFlatComboBox class.
    • Vachik Hovhannissian and Danilo Lax - For help with fixing focus and message handling bugs.
    • Yosh Yamashita - For help with fixing accelerator bug.
    • Shannon McCoy - For suggestions on using ::GetSysColor(...) and ::GetSystemMetrics(...) more efficiently.
    • Todd Brannam - For help with fixing offset bug to use GetSystemMetrics().


    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


    About the Author

    Kirk Stowell
    CEO Codejock Software
    United States United States
    No Biography provided

    You may also be interested in...

    Comments and Discussions

    Questionhow to use in a non MFC application Pin
    jishadv9-Sep-14 22:16
    memberjishadv9-Sep-14 22:16 
    NewsUpon Reflection Pin
    hibachirat2-Feb-06 15:39
    memberhibachirat2-Feb-06 15:39 
    Generaluseful but... Pin
    toxcct5-Apr-05 2:56
    membertoxcct5-Apr-05 2:56 
    GeneralCComboBoxEx me too Pin
    BadJerry5-Apr-05 2:30
    memberBadJerry5-Apr-05 2:30 
    QuestionUpgrade to a CComboBoxEx? Pin
    Jeremy Davis30-Nov-00 6:23
    memberJeremy Davis30-Nov-00 6:23 

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

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

    Permalink | Advertise | Privacy | Terms of Use | Mobile
    Web02 | 2.8.170326.1 | Last Updated 16 Dec 1999
    Article Copyright 1999 by Kirk Stowell
    Everything else Copyright © CodeProject, 1999-2017
    Layout: fixed | fluid