Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# WinForm
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 25-Jun-13 21:12pm
mg9893244
Edited 25-Jun-13 21:26pm
v2
Comments
Sergey Alexandrovich Kryukov at 26-Jun-13 2:18am
   
Not enough information. However, if you think you need a refresh, chances are, you already done something wrong.
—SA
Member 10103134 at 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 at 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
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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.
  Permalink  
Comments
Member 10103134 at 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)

  Print Answers RSS
0 OriginalGriff 6,165
1 DamithSL 4,658
2 Maciej Los 4,107
3 Kornfeld Eliyahu Peter 3,649
4 Sergey Alexandrovich Kryukov 3,382


Advertise | Privacy | Mobile
Web02 | 2.8.141220.1 | Last Updated 26 Jun 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100