How do I prevent flickering on CListCtrl?

Posted by Sorin Sbarnea on Stack Overflow See other posts from Stack Overflow or by Sorin Sbarnea
Published on 2010-03-21T10:23:20Z Indexed on 2010/03/21 10:51 UTC
Read the original article Hit count: 866

Filed under:
|
|
|

I'm using a CListCtrl/CListView report view (LVS_REPORT) in virtual mode (LVS_OWNERDATA) with LVS_EX_DOUBLEBUFFER enabled and I encounter ugly flickering. Double buffer have a real effect but it doesn't stop all flickering (without it very slow).

I'm not looking for switching to other controls that would require a high amount of rework (like ObjectListView)

How does the flickering behaves: * on column resize - the background is first clean using lightgray and after this is displayed the text (background is white) * on mouse scroll (animated) - for a very short time there is lightgray-bar displayed in the area where new lines are to be displayed.

It looks like it does clean the background using the default window background color (lightgray) for the area where it has to redraw.

How do I solve the flickering problem?

© Stack Overflow or respective owner

Related posts about c++

Related posts about clistctrl