'database collection for combobox3 (files)ĭim dctFile As New Dictionary(Of String, DataTable) 'database collection for combobox2 (subfolders)ĭim dctFolder As New Dictionary(Of String, DataTable)
Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem.Įven through it is quite strange, but you could code as this way : Imports System.IO MessageBox.Show("Run" & Environment.NewLine & IO.Path.Combine(ComboBox1.Text, ListBox1.Text)) Private Sub cmdOpen_Click(sender As Object, e As EventArgs) Handles cmdOpen.Click ListBox1.DataSource = (From this In IO.Directory.GetFiles(ComboBox1.Text) Select IO.Path.GetFileName(this)).ToList Private Sub ComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Listings.Add(IO.Path.Combine(PathName, Subdirectory))īuildDirTree(My.(PathName, Subdirectory)) Private Sub BuildDirTree(ByVal PathName As String)įor Each Folder As String In My.(PathName)
MessageBox.Show(RootFolder & " not found.")ĪddHandler ComboBox1.SelectedIndexChanged, AddressOf ComboBox1_SelectedIndexChanged If Not IO.Directory.Exists(RootFolder) Then Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Press a button and in this case are shown the path\filename where for opening the selected file use Process.Start. When the user selects a folder a ListBox is populated with files in the selected item in the ComboBox. Below is one idea which list all folders beneath a selected folder in a private variable in a ComboBox (could also be a ListBox), Personally I would suggest another route as your current idea is going to require a good deal of code and not be intuitive to users.