Solved

CStatic background in CMyView

Posted on 1998-05-12
3
212 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 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Expand LInux Boot partition remotly 3 91
sumNumber challenge 16 122
twoTwo  challenge 35 103
zeroMAx challenge 20 104
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

803 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