These two poors guys are living in the past, i.e. 2003. If you use Image.FromFile the file will remain locked until the Imge object is Disposed. The PictureBox in 2005 has new functionality that gets around that and also keeps a record of where the image came from, which may be useful if you want to save changes or whatever:
VB Code:
  1. myPictureBox.Load(myOpenFileDialog.FileName)
  2. 'OR
  3. myPictureBox.ImageLocation = myOpenFileDialog.FileName
When you load a file this way it does not remain locked and the path is stored in the ImageLocation property. Also, if you are creating an OpenFileDialog object at design time then you don't have to worry but if you are creating one on demand then make sure you Dispose it afterwards. You can do this with the Using statement in 2005:
VB Code:
  1. Using ofd As New OpenFileDialog
  2.     'Set properties of ofd here.
  3.  
  4.     If ofd.ShowDialog() = Windows.Forms.DialogResult.OK Then
  5.         myPictureBox.Load(ofd.FileName)
  6.     End If
  7. End Using
The dialogue is Disposed at the End Using statement, which contains an implicit Try...Finally so the disposal occurs even if an exception is thrown.