Solved

CStatic background in CMyView

Posted on 1998-05-12
3
216 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 100 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Expand macro to ask for filename column 8 40
Tab names are off by one 5 54
has22 challenge 11 111
how to split multiple lines delimiter : 8 134
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.

710 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