Flicker in Owner Drawn ListView in VB.NET 2.0

Flicker in Owner Drawn ListView in VB.NET 2.0

Post by jason.yfh » Wed, 17 Oct 2007 19:48:33

Hi All,

I've implemented a custom draw listview overriding

In VB.NET 1.0, the listview won't flicker. However, in VB.NET 2.0, the
same listview flicker a lot.

By observation on the listview on monitor, I found that in VB.NET 2.0,
every time when the listview item has to be painted, the item will be
painted as a default non-owner-drawn ListView item before the custom
DrawItem painting routine is run. So the item will flicker.

Now, the custom item will be drawn in message WndProc > OCM_NOTIFY

Do you have any idea to avoid the flickering? Is it possible to stop
the default non-owner-drawn ListView item repaint by screening out
this default repaint message inside WndProc?