Go Back   Computer Forums > General Computing > Programming
Click Here to Login
Join Computer forums Today

Thread Tools Search this Thread Display Modes
Old 04-28-2006, 09:54 PM   #1
Daemon Poster
Join Date: Sep 2005
Posts: 1,027
Default Show Directory in Listbox?


I am using Visual Basic and i was wondering how i would go about displaying in a listbox, or textbox, a list of the directories inside a directory....for example...

You have a folder C:\test\.....i want to display all subdirectories like C:\test\01
C:\test\02\ etc....

So the text box in this instance would look like so...

All help is greatly appreciated...



Mattyl110792 is offline   Reply With Quote
Old 05-20-2006, 12:58 PM   #2
Baseband Member
Griz803's Avatar
Join Date: Jun 2004
Posts: 89
Default Re: Show Directory in Listbox?

To the best of my recollection, you'd use a DriveListBox, a DirListBox and a FileListBox linked by properties this way to select a file and path. The code that links them is :

Private Sub Dir1_Change()
    File1.Path = Dir1.Path
End Sub

Private Sub Drive1_Change()
    Dir1.Path = Drive1.Drive
End Sub

Private Sub File1_Click()
    SelectedFile = File1.Path & "\" & File1.filename
    Image1.Picture = LoadPicture(SelectedFile)
End Sub
I hope that this snippet will guide toward what you want to do.
/*What does not kill us, makes us drink far too much caffeine*/
Griz803 is offline   Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

All times are GMT -5. The time now is 01:03 AM.

Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0