ListViewItem Array

Post here about scripting and programming for HaloPC (audio, network, ai, etc.)
Post Reply
User avatar
dos mes





Posts: 2158
Joined: Thu Dec 29, 2005 9:58 pm
Location: Syracuse, NY

ListViewItem Array

Post by dos mes »

Hmm, it seems that I haven't been able to get an answer on other forums that are just for programming so I'm hoping someone can help me out here. I'm running a large operation that add's hundreds to thousands of items to a listview, however, in order to reduce lag and allow for usability, I've added a background worker to do the job. The only problem is that the background worker can't directly interact with the main thread, and I need to be able to create an array of listviewitems, so I can declare them in the BGW and then when it's work finishes, add them to the listview finally.

This is the code that I have now, but it doesn't allow me to do this:

Code: Select all

Dim FileChunk(10000) As New ListViewItem()
Dim ItemChunk(10000) As New ListViewItem()
Dim CrapChunk(10000) As New ListViewItem()
Any help on how I could create an array that would work like you'd imagine this one too would be greatly appreciated :)
Patrickssj6




Pi Collaborator

Posts: 5426
Joined: Sat Jul 24, 2004 12:12 pm
Location: I'm a Paranoid
Contact:

Post by Patrickssj6 »

hmm...

I'll check arrays in a min.Would there be another way to do that?Like saving it to a temp.txt file?
...left for good
User avatar
dos mes





Posts: 2158
Joined: Thu Dec 29, 2005 9:58 pm
Location: Syracuse, NY

Post by dos mes »

I don't think that would be possible. I might be able to do that, but then it would just add wayy more time onto the already lengthly operation, because in most cases unfortunately, I will be needing even more than 10,000. It would be more like 100,000 - 1,000,000 items :(
Patrickssj6




Pi Collaborator

Posts: 5426
Joined: Sat Jul 24, 2004 12:12 pm
Location: I'm a Paranoid
Contact:

Post by Patrickssj6 »

Care to explain for what?
...left for good
Post Reply