CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2005
    Location
    Bangalore
    Posts
    167

    Flickering in a list view

    Hai friends
    i am developing an MDI application. In that i am having one Listview with list control.

    In that control when i update the data in every 10 milliseconds then flickering occur continiously.

    If i overwrite the OnEraseBkGnd function by command the CListView::OnEraseBkGnd(CDC* pDC) and always return TRUE from it.
    It stops the flicker but window never been redrawn. If shake the window then some shading from other windows are copied to this window.

    How can i overcome this problem.


    regards
    bagavathikumar

  2. #2
    Join Date
    Oct 2002
    Location
    Timisoara, Romania
    Posts
    14,360

    Re: Flickering in a list view

    Before starting populating it, try call RedrawWindow() with RDW_NOERASE | RDW_NOINTERNALPAINT. Then after populating it call RedrawWindow() with RDW_ERASE | RDW_INTERNALPAINT.
    Marius Bancila
    Home Page
    My CodeGuru articles

    I do not offer technical support via PM or e-mail. Please use vbBulletin codes.

  3. #3
    Join Date
    Oct 2005
    Location
    Bangalore
    Posts
    167

    Re: Flickering in a list view

    Hai Cilu
    I tried that one and it avoid the flickering but it failed to avoid the background erase. i.e. if you shake the window some background window paintings are copied to the current window and it doesn't erase until close the window.


    How can i avoid this one?


    regards
    bagavathikumar

  4. #4
    Join Date
    Oct 2007
    Location
    Fredericksburg, VA
    Posts
    41

    Re: Flickering in a list view

    I'm not exactly cilu...but....:P

    Check for the WM_WINDOWPOSCHANGING messagefor your main window in your message loop, whenever you don't have the message set your background redraw to false for the listbox (to stop the flickering) and when you do have the message change it to true (so the windows background updates properly).

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