Help, VC++ Edit Box: change the text color 
Author Message
 Help, VC++ Edit Box: change the text color

Is it possible to set the edit box text color, if the
edit text is set as "Disabled" (greyed)? The code below
works only the edit box is enabled. Your hint is highly
appreciated!

Jeff

HBRUSH CMyDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
   HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);

   switch (nCtlColor)
   {
      case CTLCOLOR_EDIT:

           if (pWnd->GetDlgCtrlID () == IDC_EDIT1)
           {
              pDC->SetTextColor (RGB(255, 0, 0);
           }
           break;

...



Sat, 01 Oct 2005 01:47:58 GMT  
 Help, VC++ Edit Box: change the text color
Is it possible to set the edit box text color, if the
edit text is set as "Disabled" (greyed)? The code below
works only the edit box is enabled. Your hint is highly
appreciated!

Jeff

HBRUSH CMyDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
   HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);

   switch (nCtlColor)
   {
      case CTLCOLOR_EDIT:

           if (pWnd->GetDlgCtrlID () == IDC_EDIT1)
           {
              pDC->SetTextColor (RGB(255, 0, 0);
           }
           break;

...



Sat, 01 Oct 2005 01:48:11 GMT  
 Help, VC++ Edit Box: change the text color

Quote:
> Is it possible to set the edit box text color, if the
> edit text is set as "Disabled" (greyed)? The code below
> works only the edit box is enabled. Your hint is highly
> appreciated!

> Jeff

http://makeashorterlink.com/?A26712634

--
Jeff Partch [VC++ MVP]



Sat, 01 Oct 2005 02:18:59 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Change the background color of a dialog box and change text color of Edit Box, Static Text, Rich Edit

2. How to change text color of edit box?

3. set text color edit box

4. Text Color In Disabled Edit Boxes

5. CAsyncSocket / Edit box text color

6. Add colored text in Edit Boxes

7. Color Text in Edit Box

8. Wrapping text in text box or edit box

9. Changing Text Color in Rich Edit Control

10. Changing Text Color in Rich Edit Control

11. Changing color of edit boxes

12. Change Back ground color of an an edit box derived Active X control

 

 
Powered by phpBB® Forum Software