Introduction
This is simple extension to the basic MFC combo box.
Usage
- Create a combo box in your dialog, make it "owner draw fixed" and "has strings".
- Then just add a member to the dialog for that combo, of type
CComboBoxBold
.
- Then use the functions of the
CComboBoxBold
as follows: CComboBoxBold::SetIcon(int itemId,int iconId);
CComboBoxBols::SetItemBold(int itemId, BOOL bold);
Example:
BOOL CBoldComboDemoDlg::OnInitDialog()
{
CDialog::OnInitDialog();
SetIcon(m_hIcon, TRUE);
SetIcon(m_hIcon, FALSE);
m_combo.SetItemBold(2,TRUE);
m_combo.SetItemBold(4,TRUE);
m_combo.SetIcon(0,IDI_ICON2);
m_combo.SetIcon(1,IDI_ICON3);
m_combo.SetIcon(2,IDI_ICON4);
m_combo.SetIcon(3,IDI_ICON6);
m_combo.SetIcon(5,IDI_ICON2);
m_combo.SetIcon(6,IDI_ICON4);
return TRUE;
}
History
Aug 6, 2003 - Updated source and demo project.