M
MrQuan
I must say, I'm completly stumped at what should be a very simple
sub...
It's purpose is to fill a ListBox with filenames from the path
specified. I know Files() receives the filenames, however the ListBox
doesn't do anything!! No items appear, I've tried everything. No
exceptions arise, nothing.
Here's the sub... am I missing something? I've also tried adding the
items individually (e.g. ListBox1.Add(Files(0)) etc, with no avail).
Public Sub FillListBox()
Dim Path As String
Dim Files() As System.Object
Path = DriveLetter & "\DOCS\"
Files = Directory.GetFiles(Path)
ListBox1.BeginUpdate()
ListBox1.Items.AddRange(Files)
ListBox1.EndUpdate()
End Sub
Many thanks,
MrQuan
sub...
It's purpose is to fill a ListBox with filenames from the path
specified. I know Files() receives the filenames, however the ListBox
doesn't do anything!! No items appear, I've tried everything. No
exceptions arise, nothing.
Here's the sub... am I missing something? I've also tried adding the
items individually (e.g. ListBox1.Add(Files(0)) etc, with no avail).
Public Sub FillListBox()
Dim Path As String
Dim Files() As System.Object
Path = DriveLetter & "\DOCS\"
Files = Directory.GetFiles(Path)
ListBox1.BeginUpdate()
ListBox1.Items.AddRange(Files)
ListBox1.EndUpdate()
End Sub
Many thanks,
MrQuan