Solved

text color of a check box

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

Title # Comments Views Activity
Visual Studio hangs on running project 6 85
How to  include  stl  library  in  Visual C++  (VS 2012) 5 47
Do Wend Macro not working 22 72
Java List 4 76
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…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

751 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