Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27349

VS 2012 Add treenodes from files within directories

$
0
0
Hi, Im using the below code to look through a directory and add the folder names as treenodes to a treeview control. I'm needing then to search the folders and add to each respective node any file that has an .xls extension. Any guidance

Thanks

Code:

Dim RootDir As New DirectoryInfo(fPath)
            For Each Dir As DirectoryInfo In RootDir.GetDirectories

                Dim item = Dir.Name

                tvProgress.Nodes.Add(item)
                tvProgress.ImageIndex = 0

                If lstPlanned.Items.Contains(item) Then
                    lstPlanned.Items.Remove(item)
                End If
            Next


Viewing all articles
Browse latest Browse all 27349

Trending Articles