|
-
Jul 23rd, 2004, 11:38 AM
#1
Thread Starter
New Member
New to VB.net: Need Help With Listboxes
Hi. I'm creating a program for a game I play. It saves every map that you've accessed into a maps folder. I've managed to extract that infor and broken it down to just the numbers. However, I'm not looking for the maps I've been to, but the maps I [i]haven't[i]been to.
There are 11,000 maps that can be loaded. I have list2 containing the map numbers that I've visited, and list3 contains all numbers 1-11,000. What would the code be to take a string from list2 and remove it from list3?
(Sorry for such a stupid question, but I'm just learning VB.)
Last edited by Vredig; Jul 23rd, 2004 at 01:12 PM.
-
Jul 27th, 2004, 05:59 AM
#2
Junior Member
for i=0 to list2.items.count-1
s = list2.items(i).text
for k= 0 to list3.items.count-1
if k<list3.items.count-1
if s=list3.items(k).text then
list3.items(k).remove
end if
end if
next
next
-
Jul 27th, 2004, 09:13 AM
#3
Frenzied Member
A listbox w/11,000 maps???? I'm always amazed when I see people load listboxes, comboboxes, etc, with thousands of items. Who the heck will ever scroll through that?
Maybe put some kind of filter before you fill the listbox, like having the user select an alphabetical range, or geographic area, or whatever.
-
Jul 27th, 2004, 11:12 AM
#4
Thread Starter
New Member
They don't need to scroll through it. They press the save button, then mail me the file. After I finish with this, I'm going to write a second to compare the results so that it will narrow it down.
-
Jul 27th, 2004, 11:37 AM
#5
Frenzied Member
Well, why put all that data in a listbox if the user doesn't interact with it themselves? It's not wrong, I just don't see the purpose of the user interface.
-
Jul 27th, 2004, 11:55 AM
#6
Thread Starter
New Member
Because I have no idea how else I could narrow down the numbers. If you could suggest a way, with code, then I'd be more than happy.
-
Jul 27th, 2004, 12:56 PM
#7
Frenzied Member
when you asked the same question in your other thread, did that zip file I created for you not help?
here's the url again in case you didn't get it.
http://andrewrichardson.us/downloads...BoxExample.zip
if you have any questions, don't be afraid to im me.
-
Jul 27th, 2004, 01:27 PM
#8
Thread Starter
New Member
It wasn't exactly what I was looking for, but I solved the problem on my own. I convert list2 to an array which is read line by line and removes each number from list3.
-
Jul 27th, 2004, 02:22 PM
#9
Frenzied Member
Originally posted by Vredig
Because I have no idea how else I could narrow down the numbers. If you could suggest a way, with code, then I'd be more than happy.
11,000 of anything I'd put in a db, or if one isn't available, an array or arraylist that the user never sees. Maybe there is a good reason that I don't see for a huge listbox.
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
|