Most likely,
ListBox
is not adequate control, as the file systems is hierarchical. (Well, it's more complex graph than a tree as there are links and symlinks (reparse points in Windows terminology), but we can forget about it.)
The more adequate control for what you want to show is
TreeView
. There is only one problem, but a pretty difficult one: the directory levels should be added dynamically and removed as the user expands and collapses nodes, otherwise performance would be unacceptable.
It looks like the authors of these article do it right:
Filesystem TreeView[
^],
http://www.codingforums.com/showthread.php?t=98085[
^].
Even if you insist on
ListBox
, reading of these articles will give you all information you may possibly need to accomplish this task.
—SA