Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Passing Data back to First Form from Second Form in C#

Tags:

People also ask

How do I transfer data from one form to another in WPF?

Just make a overload constructor which takes parameters of the window in which you want to retrieve. Example: Suppose we want a user to login from our MainWindow( i.e Login Window ) and we want to pass an int ID / string Email to our second form to retrieve data of logging user.


I have two Forms. Say FormA, FormB.

From FormA i called FormB using frmB.Show();

In FormB, i've two textboxes and a combobox controls. Assume User enters some data in those two textboxes and selected an item from combobox in Form2 and clicked an OK button.

After the click i want those textboxes user entered values, combobox selected item value back to FormA.

How can i achieve this using C#.