Office Style Flat ComboBox
For the latest updates and source code click here.

Environment: VC5, VC6, WIN9x, NT4
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 approach this.
Header file:
//{{AFX_DATA(CFlatComboDemoDlg)
enum { IDD = IDD_FLATCOMBODEMO_DIALOG };
CCJFlatComboBox m_DDCombo;
//}}AFX_DATA
//{{AFX_DATA_MAP(CFlatComboDemoDlg)
DDX_Control(pDX, IDC_DROPDOWN_COMBO, m_DDCombo);
//}}AFX_DATA_MAP
Acknowledgements
- Chris Maunder - For letting me use his color picker class. 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().
Downloads
Download demo project - 46 KbDownload source - 6 Kb

Comments
How to use the control in a DialogBar ???
Posted by Legacy on 11/13/2002 12:00amOriginally posted by: Weier
It seems no DDX operation can be done in a dialogbar????
Reply*** WARNING *** This stuff is dangerous!
Posted by Legacy on 12/12/2001 12:00amOriginally posted by: Matthias Wolff
I followd Kirks link to the "new" version of the combobox (www.codejock.com) and downloaded some of their demos.
*****
This software crashes Windows NT 4.0 (SP6) with a KMODE_EXCEPTION_NOT_HANDLED (or in simple words: a blue screen) as soon as you press any butten or open any menu.
*****
So if you love your NT you'd better keep off this stuff.
Matthias
ReplyBUG in CCJFlatComboBox::DrawCombo()
Posted by Legacy on 12/06/2000 12:00amOriginally posted by: TheFlashback
ReplyOffice style Combo : auto-incomplete
Posted by Legacy on 11/29/1999 12:00amOriginally posted by: Dennis McLeod
The autocomplete feature works nicely as long as you don't want to back up beyond the matching part of your typed string. For instance... if you type "Some Mean" ... it autocompletes with the "Some Meaningless".. which is the desired result. However, If you now try to backspace because you wanted to type "Some Meanie".. it will not let you. You have to select and delete the whole string in order to start fresh.
Reply~Dennis McLeod
THE ARTICLE AND SOURCE CODE ARE OUTDATED, PLEASE FOLLOW THIS LINK FOR THE LATEST UPDATE
Posted by Legacy on 09/12/1999 12:00amOriginally posted by: Kirk Stowell
Hello,
Until I am able to update this article, as an alternative, please visit this link http://www.codejock.com/ for the latest updates. My email address has changed also, please respond to kstowell@codejock.com...
Thanks,
ReplyKirk Stowell
Scrollbar
Posted by Legacy on 08/26/1999 12:00amOriginally posted by: Paul Reynolds
Where is the flat scrollbar drawing to go with the rest? Looks weird with it all being flat except the scrollbar...
ReplyTab functionality lost
Posted by Legacy on 06/28/1999 12:00amOriginally posted by: sheik
when i press tab, it does not tab to other controls
ReplyWhere is the - 02 Nov 1998 - Added OnSetFocus(), OnKillFocus()... Code?
Posted by Legacy on 02/03/1999 12:00amOriginally posted by: Robert Clark
The:
02 Nov 1998 - Added OnSetFocus(), OnKillFocus() and modified OnPaint() so the control remains beveled until it actually looses focus - (Vachik Hovhannissian).
code is not in the example listed here.
I tried to implement it myself and it works fine for DROPDOWNLIST style combo boxes, but not for DROPDOWN style combo's which have a child EDIT control. The latter style does not receive the proper setfocus/killfocus messages, the child edit control gets them to the focus cannot be accurate.
Has anybody experienced this and found a solution before?
ReplyMS Thumbsize bug
Posted by Legacy on 12/31/1998 12:00amOriginally posted by: Shannon McCoy
ReplyInconsistencies compared to MSWord flat toolbar combos
Posted by Legacy on 11/09/1998 12:00amOriginally posted by: Lee Alexander
ReplyLoading, Please Wait ...