Solved

Changing Background color.

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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

706 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

19 Experts available now in Live!

Get 1:1 Help Now