Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

text color of a check box

Posted on 2012-04-02
4
Medium Priority
?
674 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 2000 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
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…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

715 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