Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Skin Framework
  New Posts New Posts RSS Feed - LoadSkin() + text color of check box
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

LoadSkin() + text color of check box

 Post Reply Post Reply
Author
Message
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post Topic: LoadSkin() + text color of check box
    Posted: 20 January 2008 at 10:18am
If I enable skinning via LoadSkin(), it seems impossible to change the text color of a check box in OnCtlColor().
 
How do I enforce a specific text color on my check box, preserving the skinned style for the actual check box?
 
As soon as I disable the call to LoadSkin(), the color is successfully set. This is driving me nuts!
 
Thanks!
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 21 January 2008 at 2:21am
Hi,
Do you use CDialog derived dialog ?
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post Posted: 21 January 2008 at 3:05am

No, CWnd-derived (code is based on CXTPColorSelectorCtrl) with a CButton in it. I also tried making it transparent, which turned out to be extremely hard.

All I want is the check box to be transparent, and its text white. I handle WM_CTLCOLOR and call SetTextColor(white), SetBkMode(TRANSPARENT). It works when XP Theme/XTP Skinning is disabled, otherwise the entire control becomes black.
I also tried calling SetWindowTheme(m_btnCheck.m_hWnd, L"", L""), but that didn't help.
 
I'm getting desperate :)
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 23 January 2008 at 1:43pm
Hi,
I need sample project. too odd now. Send it to support@codejock.com
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post Posted: 24 January 2008 at 5:56pm

Just in case anybody wonders how to accomplish this; here's the final solution:

After creating the check box:
XTPSkinManager().Remove(m_checkBox.m_hWnd);
 
Then in OnCtlColor:
 
if (pWnd->GetDlgCtrlID() == IDC_CHECKBOX)
{
    pDC->SetTextColor(RGB(255, 0, 0));
    pDC->SetBkMode(TRANSPARENT);
    return (HBRUSH)m_patternBrush;
}
 
Where m_patternBrush is the pattern brush of the parent window from the window coordinates of the check box.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.109 seconds.