
how to set the color of font for a CEdit Control
You can override the OnCtlColor() .e.g
HBRUSH CEditboxDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
switch(nCtlColor)
{
case CTLCOLOR_EDIT:
switch (pWnd->GetDlgCtrlID())
{
case IDC_EDIT1: // your editbox ID
pDC->SetTextColor(RGB(255,0,0)); // change to red text color
break;
}
}
return hbr;
Quote:
}
Jimmy Leung (Hong Kong)
Quote:
> how to set the color of font for a CEdit Control! I hope to use simple
code
> to compelet the function!
> thanks