changing a text box's background color - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

changing a text box's background color

taansaritaansari Posts: 8Member
could some1 plz elaborately tell me how to change the background color of a text-box? like, step by step process? any help would be greatly appretiated!

i have tried searching for similar keywords but the replys were unclear to me...

Comments

  • TheViceTheVice Posts: 8Member
    You should subclass the CEdit control and override the WM_CTLCOLOR_REFLECT message. The write the code similar to this :

    HBRUSH CSubEdit::CtlColor(CDC* pDC, UINT nCtlColor)
    {
    pDC->SetTextColor(m_ForeColor);
    pDC->SetBkColor(m_BackColor);
    return (HBRUSH)m_Brush; // member CBrush created with m_BackCOlor
    }




Sign In or Register to comment.