Solved

CStatic background in CMyView

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

746 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now