CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 1999
    Posts
    8

    Background of Windows..

    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


  2. #2
    Guest

    Re: Background of Windows..

    Look in to Erasing the window Background in the WM_ERASEBKGND message handler, This is where you should try your code that you mentioned.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured