ComboBox经过子类化后,输入不再在ComboBox表现出来?
逸萌 2009-02-12 05:13:47 //ComboBox style:Drop-Down,可在Edit中输入,可是经过以下子类化后输入在ComboBox中没有响应,如何让ComboBox还有显示?
HBRUSH CComboBoxML::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
if (nCtlColor == CTLCOLOR_EDIT)
{
//Edit control
#if 1
if (m_edit.GetSafeHwnd() == NULL)
m_edit.SubclassWindow(pWnd->GetSafeHwnd());
#endif
}
HBRUSH hbr = CComboBox::OnCtlColor(pDC, pWnd, nCtlColor);
// TODO: Change any attributes of the DC here
// TODO: Return a different brush if the default is not desired
return hbr;
}
void CComboBoxML::OnDestroy()
{
if (m_edit.GetSafeHwnd() != NULL)
m_edit.UnsubclassWindow();
CComboBox::OnDestroy();
// TODO: Add your message handler code here
}