Click here to Skip to main content
16,016,489 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello,
I want to make background of static text and check box as transparent. Right now I put picture box as background and I change the color of picture box But it can not be changed the the background color of static text. What is the solution?
Posted

Handle the OnCtlColor message in your dialog.

Once there search for the control:
if(pWnd->GetDlgCtrlID() == m_staticTransparent.GetDlgCtrlID())

Then set the background color of the pDC to TRANSPARENT.
And set also the hbr to NULL_BRUSH. (GetStockObject...)

HTH... :thumbsup:
 
Share this answer
 
Comments
Olivier Levrey 13-May-11 4:05am    
Good answer. Have a 5.
Joan's answer is good.

You may have a look to this article as an example:
Transparent Static Text In Dialogs[^]
And/or this one:
http://www.codeguru.com/cpp/controls/editctrl/backgroundcolor/article.php/c3929[^]

----------------------
Did you check this article about transparent edit control?
CEdit & CStatic Transparency Control[^]
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900