load 1 million files into listbox from main drive or external harddrive

Mythodikal

New member
Joined
Sep 25, 2023
Messages
1
Programming Experience
1-3
Is there a quick way to load over 1 million files from my main drive on my laptop or pc into a listbox besides using simple recursion techniques? I was hoping that there was a better way than using an array and backgroundworker to do so.
 
That is a terrible UI design. Imagine being a user needing to pick through or scroll through all those items. There's a reason why a tree view exists. Also consider using the virtual mode of the list view control instead.

Why do you need a million items in a single listbox? Are you using your listbox as your data model? If so, recall what computer programmers have figured out since the late 90's: Keep your data model separate from your view (eg. UI). I agree with @cjard that you need a better approach because your current way of doing things is very bad.

Also, I vaguely recall that the list box has a 32K item limit. 32K is significant less than 1000K.
 
Anyway, if you really, really want to go down this path of making your users suffer, AND you can figure out away past the 32K limit, you can let the framework do the recursion for you:


OR

 

Latest posts

Back
Top Bottom