resource problem!

ADO DOT NET

Centurion
Joined
Dec 20, 2006
Messages
160
hi
a problem! i think may be a bug in vs.net 2005
you just put a picturebox on a form, click on image property and import a jpg picture to the application resources!
press ok.
that's ok now.
the problem is that if at a later point you want to remove that image from the resources you CANNOT!
the only way is that right click on the project explorer and open resources folder and remove the file from there, it will be removed but a warning will appear that this file does not exists!
and your application won't work until you copy a file named that deleted one in the same directory...
???
 
If you remove the image from the picturebox (right click the value of the Image property in the designer and select "Reset") does the resource not get removed from the resource file?
 
ok here is a sample!
if you remove an image file from the app resources, as I did in (pic1).
you won't be able to run the app anymore (pic2)
it seems that if we add a file to the resources, we won't be able to remove it later!
 

Attachments

Last edited:
Or, to be more general, remove the resource the same way you added it. If you simply directly added it to the solution explorer, you should be able to simple directly delete it. If you use the resource editor to add it, use the resource editor to remove it. If it is a local resource, such as an image on a button, it should automatically be deleted when the resource isn't needed, such as when you change or remove the button image. [Edit]If you add an image as a project resource through a Form designer it would need to be removed through the Resource editor.[/Edit]
 
Last edited:
Back
Top