Light from the point of code optimization, personal support yunyu97, in fact, if the use of the control of what the gap between the compiler language is not very large, because most of the operation is done in the code in the control. Even if the use of VB, optimization is good, speed is also very fast.
In this example, the code for YUNYU97 can be further optimized because the number of ListView existing rows is known:
Dim Nitems As ListItems
Dim nitem As ListItem
Dim i As Long with
listview1.listitems for
i = 0 to 10000
with. Add (,, i + 1)
. SubItems (1) = ("?? O?°? ")
. SubItems (2) = ("?? O?°? ")
. SubItems (3) = ("?? O?°? ")
End and
Next I
with
This is tested on my T60 machine, and 10000 lines are only 0.18 seconds.
Of course, if you look at it from a design point of view, adding 10000 rows of data to ListView is not a good solution in itself, consuming memory. And users do not need to view 10,000 records at the same time, the display can not display, so segmentation or pagination to join is the best way.
----------------------------------------------------------------------
Simple. Practical.
Initialize subprojects before loading to parent project
Greatly reduces the depth of the reference
Increase the speed.
Author: Zeliqing (Lee) qq:14035344