user name's code will work but it's not optimal. If you're going to add items one at a time you should call BeginUpdate first.
Code:
Me.ListBox1.BeginUpdate()
For Each file As String In IO.Directory.GetFiles("folder path here", "*.txt")
Me.ListBox1.Items.Add(IO.Path.GetFileName(file))
Next file
Me.ListBox1.EndUpdate()
Code:
Dim files As String() = IO.Directory.GetFiles("folder path here", "*.txt")
For index As Integer = 0 To files.GetUpperBound(0) Step 1
files(index) = IO.Path.GetFileName(files(index))
Next index
Me.ListBox1.Items.AddRange(files)
Code:
Dim files As String() = IO.Directory.GetFiles("folder path here", "*.txt")
For index As Integer = 0 To files.GetUpperBound(0) Step 1
files(index) = IO.Path.GetFileName(files(index))
Next index
Me.ListBox1.DataSource = files