CListCtrl Paint Issue

Discussion in 'MFC' started by garyflet, Jul 27, 2010.

  1. garyflet

    garyflet New Member

    Joined:
    Jul 27, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    I'm using Visual C++ 6 on Windows XP. When the user clicks a certain part of my List Control, a dialog box appears, and when the user is done with it, it disappears. However, if the dialog box is over part of my List Control, that part is erased and set to gray. (The empty part of the List Control is white). I want the List Control to refresh itself when the dialog box disappears. After the dialog disappears if I put another window on top and then bring the List Control back on top, it refreshes whatever portion the window covered. Or if I drag the List Control off screen and then bring it back, it refreshes whatever portion went offscreen. Of course, I don't want the user to have to do that! The List Control should refresh immediately when the dialog disappears.

    I'm trying Invalidate(), UpdateWindow() and RedrawItems() one at a time and all three at once. It makes no difference. Actually, I note that my DrawItem function is called even without calling those repaint functions. Calling them just repeats the DrawItem function being called. However, the DrawItem call has no effect.

    This problem does not occur every time. Some times the dialog disappears and the List Control refreshes correctly. Most of the time it doesn't. How do I get it to refresh every time?

    FWIW: My List Control sits in a COlePropertyPage.

    Thanks for any help..
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice