Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

releasing file after put into PictureBox

Status
Not open for further replies.

mHos

Programmer
Mar 3, 2003
19
US
I am using pictures that are embedded into a database. I can create the files, and load the picture into the picturebox. My problem arises that after I am done using the picture, I need to kill the temporary file, but I keep getting an error saying that I can't access that file because it is in use by another program. I have tried setting the image to nothing, I have also tried the picturebox.image.dispose method, but nothing seems to be working.

Does anyone have any ideas how to force the release of the file?

thanks for any help.
 
You also have to do a .dispose on the picture box.
ie.
pbox1.image.dispose()

then that should release the reference to the object that is holding it up and allow you to delete it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top