LoadSkin() + text color of check box |
Post Reply |
Author | |
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
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!
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
Do you use CDialog derived dialog ?
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
|
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 :)
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
I need sample project. too odd now. Send it to support@codejock.com
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
|
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.
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |