Hi everyone,
I am using Visual Basic
I need some help... Duh
What I need is: when I use the folder browser dialog I want the selected folder's files to be displayed in a listbox.
Also, I need the filter to be .map
Thanks ahead of time
If you help me you will get credit when my program is released on halomods.
Folder Browser Dialog
- jebmodillion
- Readers Club
- Posts: 41
- Joined: Sun Apr 08, 2007 9:43 pm
hahahahaha.....Dagger13 wrote:u dont use folder browsing dialog u use open file dialog
Well you either don't know what you are talking about or you did not read it correctly.
If you are just learning(most Likely) don't post on my question
This is what I want:
when I use the folder browser dialog(it is already tied up to a button) I want the selected folder's files to be displayed in a listbox.
Its very simple
I don't need open file dialog becuase you can only open one file and not a floder.
I haven't coded VB for a while.
That will add the filename + filetype. Example "hello.jpg".
Or...
For full path("C:\Documents and settings\ blahblah\hello.jpg") do this...
Code: Select all
Dim f As New FolderBrowserDialog
If f.ShowDialog = Windows.Forms.DialogResult.OK Then
Dim s As String()
s = Directory.GetFiles(f.SelectedPath)
For i As Integer = 0 To s.Length - 1
Dim s2 As String()
s2 = s(i).Split("\")
ListBox1.Items.Add(s2(s2.Length - 1))
Next
End If
Or...
For full path("C:\Documents and settings\ blahblah\hello.jpg") do this...
Code: Select all
Dim f As New FolderBrowserDialog
If f.ShowDialog = Windows.Forms.DialogResult.OK Then
Dim s As String()
s = Directory.GetFiles(f.SelectedPath)
For i As Integer = 0 To s.Length - 1
ListBox1.Items.Add(s(i))
Next
End If
- jebmodillion
- Readers Club
- Posts: 41
- Joined: Sun Apr 08, 2007 9:43 pm