how to set the color of font for a CEdit Control 
Author Message
 how to set the color of font for a CEdit Control

how to set  the color of font for a CEdit Control! I hope to use simple code
to compelet the function!

thanks



Wed, 17 Nov 2004 09:24:00 GMT  
 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



Wed, 17 Nov 2004 09:50:14 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. CEdit controls and changing the font color

2. simple question -- Set font for CEdit control

3. Setting font monospaced in CEdit dlg control

4. How do you set the background color of a CEdit control

5. Set text color for 1 line in a CEdit control (MultiLine)

6. Set CEdit font to COleControl Font

7. CEdit for Colored font???

8. CEdit font & color

9. set the text color and the background color of a Control Cbutton

10. Change font and color in CEdit end/or CStatic

11. CEdit Font Color / Style

12. Setting Fonts on CEdit - URGENT, please help!!!

 

 
Powered by phpBB® Forum Software