Solved

text color of a check box

Posted on 2012-04-02
4
609 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
4 Comments
 
LVL 22

Accepted Solution

by:
danaseaman earned 500 total points
Comment Utility
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
Comment Utility
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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
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…

744 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now