I'm using the code below to try and change teh color of an SDI I am using to
help me learn at the moment. It changes teh background to the color I want
but soon as I type the lines typed are in white.
Now I've got to admit I'm way over my depth here, but it is driving me a bit
nuts trying to work this out. (Maybe I should have waited a bit longer)
If this is the wrong group please direct me to a one more suited.
Thanks in advance....
Wayne...
CODE:
--------
BOOL Cnotepad_testView::OnEraseBkgnd(CDC* pDC)
{
CBrush brNew(RGB(255,255,204)); //Creates a blue brush
CBrush* pOldBrush = (CBrush*)pDC->SelectObject(&brNew);
CRect rc;
pDC->GetClipBox(rc); // Gets the co-ordinates of the client
// area to repaint.
pDC->PatBlt(rc.left,rc.top,rc.Width(),rc.Height(),PATCOPY);
//pDC->PatBlt(0,0,rc.Width(),rc.Height(),PATCOPY);
// Repaints client area with current brush.
pDC->SelectObject(pOldBrush);
return TRUE; // Prevents the execution of return
// CView::OnEraseBkgnd(pDC) statement
}