I have a representation of some files. If you click on one that is a picture, a PictureBox gives you a preview of that picture. You can also delete these files. I am implementing a Recycle Bin of sorts, but when I try to Move the file in question, I get an error that states that the file is in use by another process. This only occurs when deleting pics. I can delete other files just fine. I tried to get around this by cloning the image, but that doesn't seem to work. Here is the code I am using.
And I use this to Move the fileDim img as Image
img = Image.FromFile("C:\asdf.bmp")
Me.PictureBox.Image = img.Clone
This happens with all pics. Nothing else is using the file, only that PictureBox.File.Move("C:\asdf.bmp", "C:\RecycleBin\asdf0.bmp")
Any ideas?




Reply With Quote