Results 1 to 9 of 9

Thread: New to VB.net: Need Help With Listboxes

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2004
    Location
    Connecticut
    Posts
    7

    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.

  2. #2
    Junior Member
    Join Date
    Jul 2004
    Posts
    29
    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

  3. #3
    Frenzied Member
    Join Date
    Feb 2003
    Location
    Argentina
    Posts
    1,950
    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.

  4. #4

    Thread Starter
    New Member
    Join Date
    Jul 2004
    Location
    Connecticut
    Posts
    7
    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.

  5. #5
    Frenzied Member
    Join Date
    Feb 2003
    Location
    Argentina
    Posts
    1,950
    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.

  6. #6

    Thread Starter
    New Member
    Join Date
    Jul 2004
    Location
    Connecticut
    Posts
    7
    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.

  7. #7
    Frenzied Member
    Join Date
    Nov 2003
    Posts
    1,489
    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.

  8. #8

    Thread Starter
    New Member
    Join Date
    Jul 2004
    Location
    Connecticut
    Posts
    7
    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.

  9. #9
    Frenzied Member
    Join Date
    Feb 2003
    Location
    Argentina
    Posts
    1,950
    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
  •  



Click Here to Expand Forum to Full Width