B
Bart Steur
Hi,
I'm writing an app to maintain products. The products are listed in a
listbox and when I click a product in a listbox some info of that product is
shown including a picture of the product.
I do this by using the image.fromfile function: pbProduct.Image =
Image.FromFile(myImagePath & productkey & ".jpg")
Now I'm building the option to delete a product. When a product is selected
in the listbox a Delete button is activated. Pressing the Delete Button
deletes the product row from the database and should delete the picture from
the picturefolder, but.... It can't because it says it's in use. It's in use
by the picturebox (pbProduct). I've tested that because when I don't load
the picture when selecting the product, I can delete it (database row +
image file)
I've tried the pbProduct.Image.Dispose, setting the image to Nothing, but
none of it seems to work. Even loading a different image into the picture
box before deleting. Nothing worked.
Any ideas?
Thanks
Bart
I'm writing an app to maintain products. The products are listed in a
listbox and when I click a product in a listbox some info of that product is
shown including a picture of the product.
I do this by using the image.fromfile function: pbProduct.Image =
Image.FromFile(myImagePath & productkey & ".jpg")
Now I'm building the option to delete a product. When a product is selected
in the listbox a Delete button is activated. Pressing the Delete Button
deletes the product row from the database and should delete the picture from
the picturefolder, but.... It can't because it says it's in use. It's in use
by the picturebox (pbProduct). I've tested that because when I don't load
the picture when selecting the product, I can delete it (database row +
image file)
I've tried the pbProduct.Image.Dispose, setting the image to Nothing, but
none of it seems to work. Even loading a different image into the picture
box before deleting. Nothing worked.
Any ideas?
Thanks
Bart