Posts

Showing posts with the label Flicker

ListBox Flicker

Here's some not so simple code to solve C#'s ListBox flicker. The problem arises when the ListBox is automatically updated via some means. If its being updated via Timer or BackgroundWorker, or a Child Thread calling Invoke(), the result is the same. With anything more than a trivial number of elements, the ListBox periodically flickers when updated. Update it often and its down-right annoying. You can try the standby solutions., like wrapping your call to update the item with BeginUpdate(); //my update... and EndUpdate(); ... If that doesn't work, you can try changing your Form.DoubleBuffer property to true. this.DoubleBuffer = true; But that still may not work. You can even go and find the topics on ListView flicker. The ListView discusson on the web gets to the heart of the issue. The window is erasing the background when it doesn't need to. The solution for ListView is to derive a new class from ListView, set a few ControlStyles and then override the...