|
-
Oct 7th, 2001, 11:54 PM
#1
Thread Starter
New Member
List View API
Hello,
Am having a table which consists of 37000 rows. In my VB application am using List View Control, to which am adding 37000 rows. The loading time it is taking around 1 to 2 min, but when i use the command listview1.clear then it is taking nearly 15 to 17 min, to clear the list view control.
I had done this by using the windows common control service pack 3.0. After that to test i have changed the windows common control service pack 2.0., then for loading time it is taking maximum, but to clear the list view it is clearing with in seconds i.e. less than a one min.
So suggest me how to over come this problem. Do we have any API control to add items in the list view control and clear the list view control.
-
Oct 8th, 2001, 09:02 AM
#2
That's interesting. VB documentation says the limit for items in a ListBox control is 32767 items. Not 37000. You should limit the query to return only 32767 rows.
If you use LockWindowUpdate, it will definitely speed up both the .Clear method and the .AddItem method, by a factor of ten.
Code:
Declare Function LockWindowUpdate Lib "user32" Alias "LockWindowUpdate" (ByVal hwndLock As Long) As Long
dim i as long
i = LockWindowUpdate List1.hWnd
for x= 1 to many
List1.AddItem stuff( x)
next
i= LockWindowUpdate False
' ................
' do stuff
'
i = LockWindowUpdate List1.hWnd
List1.Clear
i= LockWindowUpdate False
-
Oct 8th, 2001, 12:09 PM
#3
jim mcnamara has a very good point. How are you getting 37,000 rows into a ListView control.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|