title: Openfiledialog Multiselect
body: <p>I am using a multiselect file dialog to browse multiple pictures and add them to a datagridview then from there store them in the database.</p>
  
  <p>Something was wrong in term of that I only managed to store the first selected picture (No syntax or runtime errors at all).</p>
  
  <p>Upon inspection I've realized that the file dialog gets the full path of the first image only and uses it for the rest of images.</p>
  
  <p>Sample code:</p>
  
  <pre><code>if (ofd_pic.ShowDialog() == DialogResult.OK)
  {
     foreach (String file in ofd_pic.FileNames)
     {
      MessageBox.Show(ofd_pic.FileName);
     }
  }
  </code></pre>
  
  <p>That messagebox will always show the path of the first image only and I wasn't able to get the path of every single selected image.</p>
  
  <p>The properties of the file dialog are:</p>
  
  <blockquote>
    <p>1.Modifiers: Private.
    2. MultiSelect: True. 3. RestoreDirectory: True.</p>
  </blockquote>
  
  <p>Any help?</p>