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#.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With