Flicker in Owner Drawn ListView in VB.NET 2.0


J

jason.yfho

Hi All,

I've implemented a custom draw listview overriding
System.Windows.Forms.ListView.

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
(&H2000+&H4E) > NM_CUSTOMDRAW (-12) > CDDS_ITEMPREPAINT (&H1 Or
&H10000).

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?

Thanks,
Jason
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top