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
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.
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
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).