i have a list box that i add file names into. the user clicks a browse button to open the file dialog and selects their files and adds them to the list box.
i want to show the file name in the listbox to the user but i also want to save the full file path.
Code:
Me.OpenFileDialogBrowseFiles.InitialDirectory = My.Settings.DownloadsLocation
Me.OpenFileDialogBrowseFiles.FileName = Nothing
Dim list As New List(Of String)
If OpenFileDialogBrowseFiles.ShowDialog = Windows.Forms.DialogResult.OK Then
For Each filePath As String In OpenFileDialogBrowseFiles.FileNames
Me.ListBoxFileNames.Items.Add(System.IO.Path.GetFileName(filePath))
Next
End If