jeudi 26 février 2015

Getting Form2 variable to Form1 (User text input in TextBox)

The plan: I want to ask the user with second Form2 to input some text. When this Form2 is closed, i want to display the input text in a textbox on Form1...


On a button event, on Form2 i can reach Form1's textbox:



Form1 form1 = new Form1();


And:



form1.myText = "Test Name";


And then i close Form2:



this.Close();


But the value "Test Name" does not appear in form1's textbox... I don't get an error.


Aucun commentaire:

Enregistrer un commentaire