vc6 可以
// CSuperComboBox message handlers
HBRUSH CSuperComboBox::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
// TODO: Change any attributes of the DC here
if (nCtlColor == CTLCOLOR_LISTBOX)
{//ListBox control,It is a COMBOLBOX,not a normal listbox.Besides,
//It is not a child window of combobox.
if (m_listbox.GetSafeHwnd() == NULL)
{
m_listbox.SubclassWindow(pWnd->GetSafeHwnd());
//too later to change the sytle!
// no vscroll !!!
m_listbox.ModifyStyle(0,WS_HSCROLL|LBS_MULTICOLUMN);
//you have to create a new list box ?
//see "Dynamically re-creating a list box" code project.
RecreateComboLBox(&m_listbox);// no messages ?
}
}
if (nCtlColor == CTLCOLOR_EDIT)
{
m_hEdit=pWnd->GetSafeHwnd();
}
//
HBRUSH hbr = CComboBox::OnCtlColor(pDC, pWnd, nCtlColor);
return hbr;
}