Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. RedrawWindow + ListControl

RedrawWindow + ListControl

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    MsmVc
    wrote on last edited by
    #1

    Hi all i am using RedrawWindow for ListControl on OnEraseBkgnd.

    BOOL CTestDlg::OnEraseBkgnd(CDC* pDC)
    {
    GetDlgItem(IDC_LIST)->RedrawWindow();
    CRect rect;
    GetClientRect(&rect);
    pDC->FillSolidRect(rect,RGB(250,273,354));
    return TRUE;
    }

    Then i am getting Listcontrol boarder disappear. Am i right or not? There is any different way to use RedrawWindow() function? Please help me. Thanks in advance

    N M 2 Replies Last reply
    0
    • M MsmVc

      Hi all i am using RedrawWindow for ListControl on OnEraseBkgnd.

      BOOL CTestDlg::OnEraseBkgnd(CDC* pDC)
      {
      GetDlgItem(IDC_LIST)->RedrawWindow();
      CRect rect;
      GetClientRect(&rect);
      pDC->FillSolidRect(rect,RGB(250,273,354));
      return TRUE;
      }

      Then i am getting Listcontrol boarder disappear. Am i right or not? There is any different way to use RedrawWindow() function? Please help me. Thanks in advance

      N Offline
      N Offline
      Niklas L
      wrote on last edited by
      #2

      Looks like you're trying to paint the control, and then immediately draw a solid rectangle over it. RedrawWindow invalidates the client region of your window. The borders are not part of that region. Then the FillSolidRect code kicks in and fills the dialog background. Now the WM_PAINT from your RedrawWindow call comes to your list controls message pump, and it redraws the invalidated region, the client area, but not the border. What behavior are you looking for?

      home

      1 Reply Last reply
      0
      • M MsmVc

        Hi all i am using RedrawWindow for ListControl on OnEraseBkgnd.

        BOOL CTestDlg::OnEraseBkgnd(CDC* pDC)
        {
        GetDlgItem(IDC_LIST)->RedrawWindow();
        CRect rect;
        GetClientRect(&rect);
        pDC->FillSolidRect(rect,RGB(250,273,354));
        return TRUE;
        }

        Then i am getting Listcontrol boarder disappear. Am i right or not? There is any different way to use RedrawWindow() function? Please help me. Thanks in advance

        M Offline
        M Offline
        Mohan Ramachandra
        wrote on last edited by
        #3

        What are you trying do? Looks like you are trying to change the background color. If that is the case handle WM_CTLCOLOR message.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups