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

x
?
Solved

Changing Background color.

Posted on 1998-07-01
1
Medium Priority
?
206 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 60 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
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.
Screencast - Getting to Know the Pipeline

971 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