Guides & Tutorials (beta)

Office Style Flat Combo Box

by Kirk Stowell Visual C++ Created on 10/16/2007  |  Updated on 07/30/2024 0/5 ( 0 votes )

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.

Office Style Combo Box

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.

Header file:

// 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

Implementation file:

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.

Secure Transactions

Online transactions are secure and protected.


Ssl seal 1
This site is protected by Trustwave's Trusted Commerce program
CompliAssure Secured

Money Back Guarantee

If you are not 100% happy with your purchase within 30 days, you can return it for any reason. Your satisfaction is our priority!


Satisfication Guarantee

Contact sales@codejock.com for more details.