list subdirectories in a ComboBox?

vbMarkO

Well-known member
Joined
Aug 19, 2005
Messages
157
How do I do this...

This is what I have but it returns a list of the subdirectories but with the full paths to them as well.

All I want is the Subdirectories within a Specific Directory.

Code:
Dim dirArr() As String = System.IO.Directory.GetDirectories("C:\Visual Studio 2005\Projects\AddressBook\")
        For Each itm As String In dirArr
            tsCombo1.Items.Add(itm)
        Next

So, what am I doing wrong?

vbMarkO
 
try
Code:
        Dim dirArr() As String = System.IO.Directory.GetDirectories("C:\Visual Studio 2005\Projects\AddressBook\")
        For Each itm As String In dirArr
            tsCombo1.Items.Add(System.IO.Path.GetFileName(itm))
        Next
 
Thanx this worked great!!!

I have also found another way to do this but your code was much simpler.

vbMarkO
 
Back
Top