Click here to Skip to main content
15,902,938 members
Please Sign up or sign in to vote.
1.40/5 (2 votes)
See more:
Refersh first form while submit second button
Posted
Comments
LLLLGGGG 15-Jun-14 10:05am    
You should give more details about your problem... But you can pass a reference of your form to the second one and then edit it from the second one... But, I repeat, we need a more detailed question in order to solve your issue.
[no name] 15-Jun-14 10:14am    
You really need to go read the FAQ for hints on how to ask a question. You would think after 3 years, you would have found the time by now.

you can use click event in second page and subscribe it in first form.
Check How to refresh parent form when in child form is button clicked?[^]
 
Share this answer
 
It really depends on what you are doing.
But...If your have this:
Form1 opens Form2.
Form2 takes user input, user presses Submit.

If Form2 then closes, and you want the data in Form1, then use ShowDialog to display Form2, and access the user data when it closes - which will be the next instruction. (You should check for OK / Cancel before using the data). This is similar to what happens when you use a MessageBox or OpenFileDialog.

If Form2 stays open, then create an even in Form2 which Form1 handles. In the event handler, use the sender parameter to identify the instance of Form2, and again access the information.

In both cases, use Properties in Form2 to supply the information: do not expose controls directly!
 
Share this answer
 
Comments
tanugarg 15-Jun-14 10:55am    
Please explain by code

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