Re: Making the clientarea of a Dialog black
- From: "AliR \(VC++ MVP\)" <AliR@xxxxxxxxxxxxx>
- Date: Thu, 16 Aug 2007 13:39:45 -0500
Wouldn't this be a slightly better solution?
HBRUSH CMyDialog::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hBrush = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
switch (nCtlColor)
{
case CTLCOLOR_DLG: hBrush = (HBRUSH)::GetStockObject (WHITE_BRUSH);
break;
}
return (hBrush);
}
AliR.
"Mark Salsbery [MVP]" <MarkSalsbery[MVP]@newsgroup.nospam> wrote in message
news:uTtoDND4HHA.5852@xxxxxxxxxxxxxxxxxxxxxxx
You could add a handler for WM_ERASEBKGND to your dialog class and draw
the background yourself, something like
BOOL CMyDialog::OnEraseBkgnd(CDC* pDC)
{
CRect rect;
GetClientRect(&rect);
pDC->FillSolidRect(&rect, RGB(0x00, 0x00, 0x00));
return TRUE;
}
Mark
--
Mark Salsbery
Microsoft MVP - Visual C++
"RAN" <nijenhuis@xxxxxxx> wrote in message
news:1187271414.136873.145480@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi,
How do i give the clientarea of my dialog a different color than grey ?
.
- Follow-Ups:
- Re: Making the clientarea of a Dialog black
- From: Mark Salsbery [MVP]
- Re: Making the clientarea of a Dialog black
- References:
- Making the clientarea of a Dialog black
- From: RAN
- Re: Making the clientarea of a Dialog black
- From: Mark Salsbery [MVP]
- Making the clientarea of a Dialog black
- Prev by Date: Re: Making the clientarea of a Dialog black
- Next by Date: Re: Transparent CStatic on Dialog with image in background
- Previous by thread: Re: Making the clientarea of a Dialog black
- Next by thread: Re: Making the clientarea of a Dialog black
- Index(es):
Relevant Pages
|