Click here to Skip to main content
15,880,796 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to refresh or reload form in windows application using c# .net
Posted
Updated 23-Jul-21 2:51am

Try this

this.Controls.Clear();
this.InitializeComponent();
 
Share this answer
 
Comments
CHill60 9-Nov-17 7:15am    
Your solution has already started to attract downvotes because this post is over 4 years old and already has a solution. Stick to answering new posts where the OP still needs help
kovax3 29-Mar-20 8:15am    
thanx work its fin
Member 14972955 2-Nov-20 14:07pm    
"Your solution has already started to attract downvotes because this post is over 4 years old and already has a solution. Stick to answering new posts where the OP still needs help"

Except, the method cjdg08 posted is actually exactly what I needed. And here we are yet another almost 4 years later, and it just so happened to be useful, as the idea proposed in Solution 1 isn't what I needed. This was. And the answers proposed here on the internet are helpful to more than just the OP - and here's the proof of that. So, thanks cjdg08. Much appreciated.
CHill60 23-Jul-21 10:16am    
Solution 1 also proposed using InitializeComponent and the suggestion of creating a SetDefaultValues method is not only a good idea, but leaves the controls in place, unlike the suggested this.Controls.Clear() which ... clears the controls collection.
As for my comment about the downvotes - I was genuinely trying to help the poster understand why other members had downvoted their solution. I did not downvote it myself.
 
Share this answer
 

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