Fastest/Most Efficient way to repopulate a listbox?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • BigPapaN0z
    New Member
    • Dec 2011
    • 24

    Fastest/Most Efficient way to repopulate a listbox?

    I'm looking for a little bit of input on this topic. The scenario is this: I have a textbox which, using the _Changed event, searches a simple string array filled with filenames for a partial match. The find/search routine works well, but the biggest drawback I'm finding is the speed at which it takes to repopulate the listbox for the results. I'm dealing with a LOT of data (10k-20k entries) and would like anyone's input on how I might be able to speed up execution. I've considered adding a timer in the _Changed event that will give the user time to type out the query before starting to repopulate (the first letter or two causes the program to temporarily freeze/pause, anything after that is fairly quick). I can post code if it's needed, but I'm not looking for a code answer, just thoughts and/or experiences from other programmers.

    Thanks in advance!

    BigPapaN0z

    PS - Using VS2010 for anyone interested.
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    I suppose the first question is why you would need a list to contain that many items. It seems unwieldy to use.

    You could just populate the first 100 or so items and then have buttons to populate the next 100 if they need to do so.

    Comment

    • BigPapaN0z
      New Member
      • Dec 2011
      • 24

      #3
      That's a definite possibility. The list is for filenames that are searchable. I'm writing a very simple karaoke rotation utility that will launch a 3rd party karaoke viewer/player. I have over 30k files, so on the first population of the listbox (for general browsing) it tends to freeze for a few seconds.

      For the time being, I have added a timer that resets every time the user types. Set it for 2 seconds, and when the timer ticks, it searches for whatever is in the search textbox and populates the listbox with the results (replacing the entire list of files available).

      Comment

      Working...