I need help with this and thanks in advance too 
I want to multi select files and display the file names into a textbox or RichTextBox and then pass the file paths to a separate function. The function will then do something to each of the files selected. I have the openfiledialog control to work for 1 file that is selected but not for all that's selected.
here's what I have so far:
I want to multi select files and display the file names into a textbox or RichTextBox and then pass the file paths to a separate function. The function will then do something to each of the files selected. I have the openfiledialog control to work for 1 file that is selected but not for all that's selected.
here's what I have so far:
Code:
Private Sub cmdLoadTextBox_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdLoadTextBox.Click
Try
With OpenFileDialog1
.Filter = "Rick Text File(*.rtf)/*.rtf/" & "Text files (*.txt)/*.txt/" & "Word Doc (*.doc)/*.doc/" & "All files/*.*"
Me.OpenFileDialog1.Multiselect = True
If .ShowDialog() = DialogResult.OK Then
'showDialog method makes the dialog box visible at run time
FileName = .FileName
Me.RichTextBox1.Text = OpenFileDialog1.FileName
myFunc(filename)
End If
End With
Catch es As Exception
MessageBox.Show(es.Message)
End Try
End Sub
Public Sub MyFunc()
'do some stuff here with each of the files selected.
End Sub