Cam

Cam

  • NA
  • 6
  • 0

Access to file used in picturebox

May 21 2008 7:38 PM

I've got a form in a MDI project that contains a picturebox control.  I populate the control like this...

newimage = Image.FromFile("c:\temp.bmp")
Me.PictureBox1.Image = newimage

I need to later kill the file "c:\temp.bmp", but even after executing the dispose method of the picturebox control I get the error "The process cannot access the file 'c:\temp.bmp' because it is being used by another process."  What am I missing here? 

Any help would be greatly appreciated. 

Thanks,
Cam


Answers (2)