I want to use an open file dialog, and be able to select multiple images and have their full path names loaded in an array of an unspecified size... so far I've got to here, but am stuck at how to proceed.

Can someone help?

VB Code:
  1. Private Sub Menu_Open_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Menu_Open.Click
  2.  
  3.         'declares undefined array
  4.         Dim Picturelist() As String
  5.  
  6.         Dim fileName As String
  7.         Dim i As Integer
  8.  
  9.         ofdPicture.InitialDirectory = "C:\"
  10.         ofdPicture.Multiselect = True
  11.         ofdPicture.Filter = "Image Files (*.BMP;*.JPG;*.GIF;*.PNG;*.TIFF)|*.BMP;*.JPG;*.GIF;*.PNG;*.TIFF"
  12.         ofdPicture.ShowDialog()

I know I'm meant to use ReDim but how would I "count" the number of individual files that have been selected by the user?

Would I have to use a loop to put the path name into the array? Something like

VB Code:
  1. For i = 1 To Picturelist.GetUpperBound(Picturelist)
  2.             ReDim Preserve Picturelist(Picturelist.GetUpperBound + 1)
  3.             Picturelist(i) = ofdPicture.FileName
  4.         Next i