J
Jos Roijakkers
At some point in my application I load an image into a picturebox with the
code:
pbGraphic.Image = Image.FromFile("picture.jpg")
Later on in the program I want to rename the file using the code:
pbGraphic.Image = Nothing
My.Computer.FileSystem.RenameFile("picture.jpg","newname.jpg")
but I get an IOException: "The process cannot access the file because it
is being used by another process."
Why is the original file still locked and what can I do to unlock it?
Any help is welcome.
Tnxs
code:
pbGraphic.Image = Image.FromFile("picture.jpg")
Later on in the program I want to rename the file using the code:
pbGraphic.Image = Nothing
My.Computer.FileSystem.RenameFile("picture.jpg","newname.jpg")
but I get an IOException: "The process cannot access the file because it
is being used by another process."
Why is the original file still locked and what can I do to unlock it?
Any help is welcome.
Tnxs