I'm trying to store the file path in a tag of a listbox item.
I'm using the below to search through and add the desired folder name to the list box
I've added the ListBox1.Tag = sDir
line to above the first Next
and when I step thorugh the code the value of sDir
appears to hold the path however if I create a simple Double click
event that pops up a message box with the file path in it only shows the first folder name in the list.
Any tips or advice - I basically want to select a Listbox item and have it point to its path!
Thanks
For Each Dir As String In System.IO.Directory.GetDirectories("c:\Working")
Dim dirInfo As New System.IO.DirectoryInfo(Dir)
For Each sDir As String In System.IO.Directory.GetDirectories(dirInfo.ToString)
Dim sdirInfo As New System.IO.DirectoryInfo(sDir)
ListBox1.Items.Add(sdirInfo.Name)
ListBox1.Tag = sDir
Next
Next