Главная страница | назад





Article #16952: Adding way too many items to a TListView

 Question and Answer Database

FAQ1952C.txt   Adding way too many items to a TListView
Category   :VCL
Platform    :All
Product    :C++Builder  3.x

Question:
I have an inordinately large number of items (4000) I want to
add to a TListView, and it takes about 30 seconds on a 166. 
What can I do to speed it up?

Answer:
Using a profiler, it has been determined that the major delay
from the Win32 API ListView control.

While you obviously cannot do anyting to speed it's code up, you
can run the operation in a separate thread, it has been reported that
API operations in a second thread (not main thread) are ~5 times
faster.  This will also let the user see the box fill and do other
things while it is filling, which gives the illusion of not having
to wait around.



7/2/98 10:32:32 AM
 

Last Modified: 01-SEP-99