Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing Static Text Color Issue

Status
Not open for further replies.

nbgoku

Programmer
May 25, 2004
108
US
Code:
HBRUSH CAboutDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
	HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
	if (pWnd->GetDlgCtrlID() == IDC_EDIT2)
	{
		pDC->SetTextColor(RGB(255, 0, 0));
		hbr = m_brush;		
	}
	return hbr;
}

this code works beautifully when changing an edit box (IDC_EDIT2), but if i put a static name instead like IDC_STATIC1, the static stays the same color (it doesnt change colors), anyone know how this can be solved? im just trinyg to change 1 static and leave the rest alone
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top