Hello!
I use VB.NET and I have a form which contain a picturebox control that I fill with a choosen image by:
Me.picImage1.Image = FromFile("1.jpg")
Then I have a different button which suppose to clear the picturebox control, and delete the file itself from the original windows directory.
The problem is that the picturebox is being cleared, but the file cant be deleted. It seems that its locked or something, and Im able to delete it only after I close the running program.
Does anyone know what can be done in order to delete the file during runtime?
Thanks!
Tom.
I use VB.NET and I have a form which contain a picturebox control that I fill with a choosen image by:
Me.picImage1.Image = FromFile("1.jpg")
Then I have a different button which suppose to clear the picturebox control, and delete the file itself from the original windows directory.
The problem is that the picturebox is being cleared, but the file cant be deleted. It seems that its locked or something, and Im able to delete it only after I close the running program.
Does anyone know what can be done in order to delete the file during runtime?
Thanks!
Tom.