Solved

Changing Background color.

Posted on 1998-07-01
1
198 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
xyBalance chalenge 58 96
Separate into files by filename 12 87
deburging in oracle form 12 104
How do I get Window Title of all opened process? 4 11
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: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
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.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

807 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