The CXTFlatComboBox class can easily give your application the Flat Look to your standard CComboBox control as seen in many of the Microsoft® Office products. To use the control, simply add the files XTFlatComboBox.cpp and XTFlatComboBox.h to your project, you can use the Class Wizard to add the CComboBox member variable ( Class Wizard -> Member Variables Tab -> Add Variable ) and rename CComboBox to CXTFlatComboBox.
Below is an example of how you might add the control to your project. The CXTFlatComboBox class is a member of the Standard Toolkit. Feel free to use it in any of your projects.
// Dialog Data //{{AFX_DATA(CFlatComboDemoDlg) enum { IDD = IDD_FLATCOMBODEMO_DIALOG }; CXTFlatComboBox m_DDCombo; CXTFlatComboBox m_DLCombo; BOOL m_bDDAutoComp; BOOL m_bDDDisable; BOOL m_bDLDisable; //}}AFX_DATA
void CFlatComboDemoDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CFlatComboDemoDlg) DDX_Control(pDX, IDC_DROPDOWN_COMBO, m_DDCombo); DDX_Control(pDX, IDC_DROPLIST_COMBO, m_DLCombo); DDX_Check(pDX, IDC_DROPDOWN_AUTOCOMP, m_bDDAutoComp); DDX_Check(pDX, IDC_DROPDOWN_DISABLE, m_bDDDisable); DDX_Check(pDX, IDC_DROPLIST_DISABLE, m_bDLDisable); //}}AFX_DATA_MAP }
User Comments
No comments yet, sign in to comment.