P
Paul Hadfield
Hi Guys,
Real simple question here I'm sure. I'm trying to display a JPEG in a
picture box (VB.NET 2003).
pb.Image = Image.FromFile("C:\pic.jpg")
Then, later in the program I need to delete the image file from the disk.
pb.Image = Nothing
IO.File.Delete("C:\pic.jpg")
But I can't as the file is still open/in use. If I try to delete the image
file without displaying it in the picture box first it deletes fine, so I
know it's the picture box that's still got hold of the image file somehow.
What am I missing?
Cheers,
Paul.
Real simple question here I'm sure. I'm trying to display a JPEG in a
picture box (VB.NET 2003).
pb.Image = Image.FromFile("C:\pic.jpg")
Then, later in the program I need to delete the image file from the disk.
pb.Image = Nothing
IO.File.Delete("C:\pic.jpg")
But I can't as the file is still open/in use. If I try to delete the image
file without displaying it in the picture box first it deletes fine, so I
know it's the picture box that's still got hold of the image file somehow.
What am I missing?
Cheers,
Paul.