Link to home
Start Free TrialLog in
Avatar of i950
i950

asked on

Preventing listView from flickering

Hello,

I'm adding a lot of items to a listView in a loop.

How can I prevent it from flickering?

Thank you.
ASKER CERTIFIED SOLUTION
Avatar of Babycorn-Starfish
Babycorn-Starfish
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SuspendLayout()
Resume or PerformLayout()
DoubleBuffered = true or
SetStyle() and check for ControlStyles that may help (AllPaintingInWmPaint, OptimizedDoubleBuffer )
Avatar of Manjesh
Manjesh

LockWindowUpdate(Listbox.handle); // from GDI   use PInvoke
....
update
.....
LockWindowUpdate( NULL );