Click to See Complete Forum and Search --> : Background of Windows..


stou
July 10th, 1999, 05:35 AM
Hi, I am trying to erase the background of a window... extreamly simple thing... unfortunatly I just recently started writing UI code so I have no clue why what I am trying to do does not work... I simply try calling

pDC->SetBkColor(RGB(192,192,192));

to set the background of a window to light gray.... but when I run the application nothing at all happens... its still white!

I also needed to paint a small light gray rectangle and I tried doing
CBrush* brsh = NULL;
brsh = (CBrush*)pDC->SelectStockObject(GRAY_BRUSH);
pDC->FillRect(rctRoomNum, brsh);




to fill a recatngle with a gray color... it doesn't work... if I try instead of the call to GetStockObject a call like "brsh = new CBrush(&bmpStat);" it fills that rectangle with the bitmap.... I am very frustrated with trying to make this thing work... can someone please help me... I am sure its something very simple...

Thanx

Stou

July 11th, 1999, 07:27 PM
Look in to Erasing the window Background in the WM_ERASEBKGND message handler, This is where you should try your code that you mentioned.