Changing background Color of CRect
I have the code as below:
Code:
CRect textRect (10,20,30,40);
CStatic *text = new CStatic;
text->Create("Text",allstyle| SS_LEFT ,textRect,&m_Panel);
Note: m_Panel is a scrollbarPanel
Now question is background color of area covering text(texxtRect) is grey,i want to color it white.How to do it with above code?
Re: Changing background Color of CRect
Quote:
Originally Posted by
Beginner_MFC
I have the code as below:
Code:
CRect textRect (10,20,30,40);
CStatic *text = new CStatic;
text->Create("Text",allstyle| SS_LEFT ,textRect,&m_Panel);
Note: m_Panel is a scrollbarPanel
Now question is background color of area covering text(texxtRect) is grey,i want to color it white.How to do it with above code?
Learn how to create control variables. All this stuff you are asking for is the same. Create a control variable of the appropriate type and then use its methods.
Re: Changing background Color of CRect
A CRect isn't a window. It has no color.
You may want to read up on CWnd::OnCtlColor