I have just seen a resurrected thread about issues with loading images to a PictureBox and the inability to delete the file while the program is running. There was no clear explaination of the problem, only suggested hacks and apparent frustration.
So I thought I would offer this explanation from Microsoft:
When either a Bitmap object or an Image object is constructed from a file, the file remains locked for the lifetime of the object. As a result, you cannot change an image and save it back to the same file where it originated.
Additionally, if the stream was destroyed during the life of the Bitmap object, you cannot successfully access an image that was based on a stream. For example, the Graphics.DrawImage() function may not succeed after the stream has been destroyed.
GDI+, and therefore the System.Drawing namespace, may defer the decoding of raw image bits until the bits are required by the image. Additionally, even after the image has been decoded, GDI+ may determine that it is more efficient to discard the memory for a large Bitmap and to re-decode later. Therefore, GDI+ must have access to the source bits for the image for the life of the Bitmap or the Image object.
To retain access to the source bits, GDI+ locks any source file, and forces the application to maintain the life of any source stream, for the life of the Bitmap or the Image object.
To make a long story short for their suggested workarounds, I have created the function shown to return an image and not lock the file.
example usage: PictureBox1.Image = GetImageFile("KeepGDIPlusFromLockingMe.jpg")