-
December 17th, 2019, 06:14 AM
#1
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?
-
December 19th, 2019, 03:42 AM
#2
Re: Changing background Color of CRect
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.
-
December 19th, 2019, 08:43 AM
#3
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
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|