I have a subclass of CEdit called CEditColor. I also have a OnCtlColor function in my dialog. I need to skip the OnCtlColor function when the control is CEditColor. Is there a way to tell what the dialog item class is so I can code the skip?
Here is my OnCtlColor....
Code:if(m_bCustomColors) { HBRUSH hbr = NULL; switch(nCtlColor) { case CTLCOLOR_MSGBOX: break; case CTLCOLOR_EDIT: pDC->SetBkColor(m_colorListBoxBk); pDC->SetTextColor(m_colorListBoxText); hbr = m_brushListBox; break; case CTLCOLOR_SCROLLBAR: break; case CTLCOLOR_MAX: break; case CTLCOLOR_STATIC: pDC->SetBkMode(TRANSPARENT); pDC->SetTextColor(m_colorStaticText); hbr = m_bkBrush; break; case CTLCOLOR_DLG: hbr = m_bkBrush; break; case CTLCOLOR_LISTBOX: pDC->SetBkColor(m_colorListBoxBk); pDC->SetTextColor(m_colorListBoxText); hbr = m_brushListBox; break; case CTLCOLOR_BTN: pDC->SetBkColor(m_colorButtonBk); hbr = m_brushButton; break; default: break; } // hbr = NULL; if(hbr == NULL) hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor); return hbr; } else { return CDialog::OnCtlColor(pDC, pWnd, nCtlColor); }




Reply With Quote