Click to See Complete Forum and Search --> : How to read DirList box names?


TheBoneCollector
May 4th, 2001, 08:50 AM
Any one know how to read names of folder in a dirlistbox? (im not lookking for path)
i want to set up a for/next loop to read the name of all folders listed in a dirlistbox

Thanks!

coolbiz
May 4th, 2001, 06:29 PM
Play with the code below and see if it helps.

1. Create new project with a form (Form1).
2. Add DirListBox on the Form1 (Dir1).

private sub Form_Load()
Dir1.Path = "C:\"
end sub

private sub Dir1_Click()
dim i as integer
for i = 0 to (Dir1.ListCount-1)
debug.print i & ". " & Dir1.List(i)
next i
end sub




-Cool Bizs