tags:

views:

82

answers:

1

What code will I put in the open file dialog box_fileok if the multi select feature is enabled. I currently have this code, but it only shows in the textbox the last file that has been selected.

  Dim strm As System.IO.Stream
        strm = OpenFileDialog3.OpenFile()
        TextBox3.Text = OpenFileDialog3.FileName.ToString()
        If Not (strm Is Nothing) Then
            //insert code to read the file data
            strm.Close()
            MessageBox.Show("Done!")
        End If
+1  A: 

Use the FileNames property. It returns a string array containing all selected files.

TextBox3.Text = String.Join(Environment.NewLine, OpenFileDialog3.FileNames)
' Displays each filename on a separate line
Snarfblam