Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DirListbox?

Status
Not open for further replies.

Gti

Programmer
Jul 23, 2001
99
PT
How can i make a Dirlistbox?

Tkx

;-)
 
I'm assuming you want to put a directory list into a list box.

Drop a list box onto your form. The default name should be List0 which is what I use in my sample below. In an appropriate event call the sub FillList() and pass it the path that you want and the list box will be filled.

Example call:
FillList("C:\")

Sub FillList(strPath As String)
Dim str As String
Dim strTemp As String
strTemp = Dir(strPath)
Do
str = str & strTemp & ";"
strTemp = Dir 'subsequent calls to Dir gets next file
Loop Until Len(strTemp) < 1
List0.RowSource = str
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top