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
Solved

text color of a check box

Posted on 2012-04-02
4
636 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
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

791 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