I am building an indexer application based on a suffix tree, that enables me to index whole documents and search strings, substrings, etc, extremely fast.
What I'm doing is entering a string in a textbox, pressing a button, and running a function that queries the suffixtree and adds the positions of all occurences of the string to a listbox. So the listbox has a lot of integers inside it.
Normally, this works fine. For instance, searching for "wizard" or "Gandalf", or "hobbit" (I am indexing FOTR as a test :D) works fine and dandy. However, I'm trying it out now with the letter e.
The problem is that the positions of the letter e do get listed inside the listbox. All 88974 of them. However, when I'm scrolling down by dragging the scroller button, the listbox appears to circularly go back to the top when I'm at around item 60000 or so. The problem is made wierder by the fact that I've tried scrolling with page down and everything works ok.
I know that scrolling through 88974 (based on listbox.Items.Count) items is a bit extreme, but logically, there is no reason why there should be such a problem.
Thanks for reading this far!
EDIT : To all those who answered, thanks for answering. I've finally implemented this with a listview, and it's much faster, and can hold many items quite well. Thanks!