• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 207
  • Last Modified:

Changing Background color.

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
cMan
Asked:
cMan
1 Solution
 
chensuCommented:
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now