Click here to Skip to main content
15,884,947 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi all,

I have a picturebox. I set the default image to a picture with some word. So it embed in the textbox. So I load this picturebox using code. The when I click on Reset button, I will dispose the image that been hold. So how to set back the default image after I dispose it?
Posted

1 solution

There is no such thing as "default image". You just have one Image property. You should keep the reference to such image if you need it.

—SA
 
Share this answer
 
Comments
Luiey Ichigo 19-Mar-14 2:16am    
I have select 1 image that will place on the picturebox (PB) when the form load. Whenever I bring the .exe file, it will show where there is no image besides the .exe file. I know it embed into the program. That is the image that I want to display when I remove an image that I load to the PB. 1 image per PB. But if I dispose the image, it will show a blank PB on my program. Not a default image that appear when I load the form
Sergey Alexandrovich Kryukov 19-Mar-14 10:24am    
There is no "default image". You should create such notion if you need it. One way or another. This is trivial. Forget PictureBox. You can create equivalent control yourself (deriving from PictireBox or not): with two Image properties: default and non-default.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900