Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

CStatic background in CMyView

Posted on 1998-05-12
3
Medium Priority
?
231 Views
Last Modified: 2013-11-20
Hi!
I have create a CStatic control in my view, but I can't change the background color of the control becouse I can't process the WM_CTLCOLOR message from my view class.
How can I change the background color?
Thank you,
Tibi.

0
Comment
Question by:visualc
3 Comments
 
LVL 3

Expert Comment

by:tma050898
ID: 1310022
What do you mean when you say that you "can't change the background color of the control" using WM_CTLCOLOR? Are you say that is the problem or that for some reason you don't want to change the static's background color via this mechanism???
0
 
LVL 11

Accepted Solution

by:
mikeblas earned 200 total points
ID: 1310023
To change the background of the control, you need to have the control's parent handle WM_CTLCOLOR appropriately. If you can't process the message, it's because you've improperly created the static control as the child of some othe window.

.B ekiM

0
 
LVL 10

Expert Comment

by:RONSLOW
ID: 1310024
Please show you code (not just one line, either) where you create the static control.

Also show how you set up your WM_CTLCOLOR handler.

What you might like to try is deriving a class from CStatic that handles the WM_CTLCOLOR itself (use message reflection).  Then create a control of this type instead.  It is (generally) good OO design to let the cotrol class itself handle these sort of  messages.


0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
Ready to get certified? Check out some courses that help you prepare for third-party exams.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …

876 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question