ListView ownerdrawn performance

  • Thread starter Thread starter Chris
  • Start date Start date
C

Chris

Hi all,

I've been testing a listview control on an app I'm creating which is in
'details view' with 3 columns. It can contain string information from 4
different objects (linked with Tag), each drawn with a unique colour. When I
load in 2000 (or even as low as 500) objects the performance hit is quite
bad, I had to derive a new control from ListView so I could enabled double
buffering on the control. This stops the flickering, but there is a
noticeable lag when scrolling the vertical bar up and down. Even having as
few as 200 objects displayed creates a slight lag.
At first I thought this might be due to me using many different colours, so
I tried redrawing in just one colour and the same thing happens. What looks
worse is minimising the form, and then restoring it, the listview doesn't
draw (so the desktop can be seen through it) for a few seconds (I guess it's
drawing the contents of the listview during that time).
If I turn off ownerdrawn there is no lag on drawing even 2000 items,
although there is a few second delay on loading the items.
Is this performance hit normal for ownerdrawn listview controls? If not,
any tips on removing it would be appreciated!

Chris
 
Chris said:
Hi all,

I've been testing a listview control on an app I'm creating which is in
'details view' with 3 columns. It can contain string information from 4
different objects (linked with Tag), each drawn with a unique colour. When
I load in 2000 (or even as low as 500) objects the performance hit is
quite bad, I had to derive a new control from ListView so I could enabled
double buffering on the control. This stops the flickering, but there is a
noticeable lag when scrolling the vertical bar up and down. Even having as
few as 200 objects displayed creates a slight lag.
At first I thought this might be due to me using many different colours,
so I tried redrawing in just one colour and the same thing happens. What
looks worse is minimising the form, and then restoring it, the listview
doesn't draw (so the desktop can be seen through it) for a few seconds (I
guess it's drawing the contents of the listview during that time).
If I turn off ownerdrawn there is no lag on drawing even 2000 items,
although there is a few second delay on loading the items.
Is this performance hit normal for ownerdrawn listview controls? If not,
any tips on removing it would be appreciated!

Chris

Sorted it out, had an unnecessary loop in the draw routine :)

Chris
 
Back
Top