Click here to Skip to main content
15,886,799 members
Articles / Mobile Apps / Windows Mobile

Office Style Flat ComboBox

Rate me:
Please Sign up or sign in to vote.
3.73/5 (18 votes)
15 Dec 1999 126.9K   5.3K   50   5
A drop-in replacement combobox that gives your apps the flat Office-style look

Sample Image - combobox_flatcombo.gif

Introduction

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.

Example

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

Header File

//{{AFX_DATA(CFlatComboDemoDlg)  
enum { IDD = IDD_FLATCOMBODEMO_DIALOG };  
CCJFlatComboBox m_DDCombo;  
//}}AFX_DATA  

Implementation File

//{{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, 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()

History

  • 16th December, 1999: Initial version

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.


Written By
CEO Codejock Technologies, LLC
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.
This is a Organisation (No members)


Comments and Discussions

 
Questionhow to use in a non MFC application Pin
jishadv9-Sep-14 21:16
jishadv9-Sep-14 21:16 
NewsUpon Reflection Pin
hibachirat2-Feb-06 14:39
hibachirat2-Feb-06 14:39 
Generaluseful but... Pin
toxcct5-Apr-05 1:56
toxcct5-Apr-05 1:56 
GeneralCComboBoxEx me too Pin
BadJerry5-Apr-05 1:30
BadJerry5-Apr-05 1:30 
QuestionUpgrade to a CComboBoxEx? Pin
jerry0davis30-Nov-00 5:23
jerry0davis30-Nov-00 5: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.