Click here to Skip to main content
15,886,724 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
In the winforms I have created I have some textboxes and pictureboxes. On running the form I have uploaded images in pictureboxes using fileopendialog and have used the text in textboxes. Now I want to Refresh the form, to again select some images and load. I have used this.refresh but its not giving the appropriate result, Also I don't want to use application.restart.
Thanks in advance.
Posted
Updated 25-Jun-13 20:26pm
v2
Comments
Sergey Alexandrovich Kryukov 26-Jun-13 2:18am    
Not enough information. However, if you think you need a refresh, chances are, you already done something wrong.
—SA
mg9893 26-Jun-13 2:23am    
I cant post my whole code here because its too big. I have done many things (related to Image Processing), using the image loaded in pictureboxes and data in textbox. Any possible area, where one can commit mistakes in these situations?
Sergey Alexandrovich Kryukov 26-Jun-13 2:29am    
I understand. Such problems are solved in this way: you create a simple project in order just to manifest on single problem. If should be as simple as possible but complete. Chances are, you will locate the problem by yourself down the road. If not, it might be good enough to post in your question.
—SA

Post sample code..to get correct idea about your requirements,

Here you can use same opendialog to load image again and again. and dispose the previous image if it is not needed... this.Refresh() will never give you any pop up boxes to load new images.
 
Share this answer
 
Maybe this help you
You can use the constructor, in a refresh button click try to close the current form and call the same form with the constructor parameters which will load with new instance.
 
Share this answer
 
Comments
mg9893 26-Jun-13 9:24am    
I think it is similar to application.restart.Is it ? Can you please provide the example code or something to make it more clear ? Thanks in advance.

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