Click here to Skip to main content
15,896,063 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How to Refresh automatically the form1 paticular Controls, after insert the data in form 2 using c# winforms. Anyone Please give the proper Solution

What I have tried:

How to Refresh automatically the form1 paticular Controls, after insert the data in form 2 using c# winforms. Anyone Please give the proper Solution
Posted

1 solution

Depends on how you displayed Form2, but it's pretty much the same either way: you use properties in Form2 which Form1 can access when it needs the data. Form1 then updates it's own controls as necessary.

If you displayed Form2 with ShowDialog, then just wait until the form closes and the code will continue from the next line - exactly like using an OpenFileDialog does.
If use used Show, then Form2 will need to raise an event that Form1 handles: that could be the FormClosed event, or one of your own making.

See here: Transferring information between two forms, Part 2: Child to Parent[^]
 
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