How in c# to do the correct handling clicks?

Have form 1, it creates a form 2, form 2 two textbox and button, you need to do so by clicking this button, the data from textbox1 enrolled in variable 1 and variable 2 in textbox2 and the form closed. Form 2 is run in a separate thread. How to implement it? in particular the button1 += new EventHandler(method);
but method() does not work to get the data from формы2 and close it too.
private void zapusk_form2(object sender, EvantArgs e)
Thread tr = new Thread(go)
public void go()
 Autent Thread = new Thread(aut);
public void aut()
 Auts Form2 = new Form2();
 auts.button1.Click += new EventHandler(metod);
 public string login;
 public string pass;
 private void metod(object sender, EventArgs e)
 login = auts.textBox1.Text;
 pass = auts.textBox2.Text;

April 19th 20 at 12:34
2 answers
April 19th 20 at 12:36
Keep project.
Your username in the right way. Note the docking controls in the second form.
And most importantly, select a global object in which the application logic. But to just assign variables. In General as less as possible code in the forms.
April 19th 20 at 12:38
In fact Your question - save the values in global variables. You can display them in a separate module.
A bit of lyrics. You have a very non-thread-safe code. To reference controls and forms inside flow always use invoke. Otherwise sudden program crashes with an error. Also for me is not clear - why start a thread that in turn starts another thread...
If the flow is interesting for You, read this wonderful article:

Find more questions by tags C#Windows Forms