Solved

Changing Background color.

Posted on 1998-07-01
1
193 Views
Last Modified: 2013-11-19
From within which implementation file, and from within which function do I call CWnd::SetBKColor(RGB rgb) to
set the background color for my view?
0
Comment
Question by:cMan
1 Comment
 
LVL 23

Accepted Solution

by:
chensu earned 30 total points
ID: 1318613
To change the background color of your view, override the CWnd::OnEraseBkgnd of your view. For example,

.
ON_WM_ERASEBKGND()
.

BOOL CYourView::OnEraseBkgnd(CDC* pDC)
{
    CRect rect;
    this->GetClientRect(&rect);

    pDC->FillSolidRect(&rect, RGB(0, 0, 255));

    return TRUE;
}

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Named range not carried over 10 62
conditional code and condition difference 9 77
fizzArray  challenge 1 63
abstract class with all non abstract mentods 6 76
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…
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.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

867 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

20 Experts available now in Live!

Get 1:1 Help Now