title: Open file from a listbox
body: <p>I'm trying to open files from a <code>listbox</code>, the files could be <strong>Word</strong>, <strong>PDF</strong>, <strong>Excel</strong>, etc. Does there need to be separate code for each file type, or is there some way to just open the file when its double clicked?</p>
  
  <p>The <code>listbox</code> populates fine through the use of the update <code>button</code> I have.</p>
  
  <pre><code>Public Class frmMain
  
  Private Sub ButtonUpdate_Click(sender As Object, e As EventArgs) Handles ButtonUpdate.Click
      Dim folderInfo As New IO.DirectoryInfo("my directory is here")
      Dim arrFilesInFolder() As IO.FileInfo
      Dim fileInFolder As IO.FileInfo
      arrFilesInFolder = folderInfo.GetFiles("*.*")
      For Each fileInFolder In arrFilesInFolder
          ListBox1.Items.Add(fileInFolder.Name)
      Next
  End Sub
  
  Private Sub ButtonExit_Click(sender As Object, e As EventArgs) Handles ButtonExit.Click
      Me.Close()
  End Sub
  
  Private Sub ListBox1_DoubleClick(sender As Object, e As EventArgs) Handles ListBox1.DoubleClick
  
  End Sub
  
  End Class
  </code></pre>