dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: drawing problems Property Page

Threaded View

  1. #1
    Join Date
    Dec 2008
    Posts
    1

    drawing problems Property Page

    I have a property page with a static control area defined as

    CONTROL "",IDC_TEMP_GRPH,"Static",SS_GRAYFRAME,154,44,135,129

    I am handling WM_PAINT message and the following piece of code gets executed:

    CDC* pDC = new CDC(GetDC(this->m_hWnd));
    HWND hStatic = GetDlgItem(m_hWnd,IDC_TEMP_GRPH);
    RECT pirect;
    GetClientRect(hStatic,&pirect);
    COLORREF bkColor; bkColor = RGB(225,0,0);
    HBRUSH hBrush = ::CreateSolidBrush(bkColor);
    ::FillRect(GetDC(hStatic),&pirect,hBrush);

    The problem is I am not able to see this solid color block. It appears blinking while I drag the Property Sheet but disappears when I switch to next page and switch back to that page. Can anyone please tell me what is missing here?
    Last edited by koumodaki; December 17th, 2008 at 06:18 AM.

Posting Permissions

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


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)