Solved

text color of a check box

Posted on 2012-04-02
4
662 Views
Last Modified: 2012-08-02
Hello,

I have overwritten the OnCtlColor function where we are changing the text color of a check box. But it is not working. Please help on that.

code:

HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{


      if(nCtlColor == CTLCOLOR_BTN)
      {
            pDC->SetBkMode(TRANSPARENT);
            pDC->SetTextColor(RGB(255, 0,0));
      }

return m_brush;//white brush
      
}

We are using MFC.

Note: It works on windows classic theme but doesn't work in window7.
0
Comment
Question by:harish_dixit1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 22

Accepted Solution

by:
danaseaman earned 500 total points
ID: 37800364
When themes are enabled (i.e. not Classic) ComCtl6 takes over the drawing of Check, Option, and CommandButton so I doubt you could change this unless you make your own custom control and draw the text manually via API TextOut or DrawText.
0
 
LVL 53

Expert Comment

by:Dhaest
ID: 38249576
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Make the most of your online learning experience.
What do responsible coders do? They don't take detrimental shortcuts. They do take reasonable security precautions, create important automation, implement sufficient logging, fix things they break, and care about users.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
Progress
Suggested Courses

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question