Form2 form2 = new Form2(); form2.referenceForm1 = this; // Soit tu fournis la référence comme ça form2.ShowDialog();
public Form1 referenceForm1 = null; //[...] void BoutonCreeForm3_Click(object sender, EventArgs e) { Form3 form3 = new Form3(referenceForm1, this); // Soit tu la fournis par le constructeur form3.ShowDialog(); }
public Form3(Form1 form1, Form2 form2) { InitializeComponent(); MaTextBox1.Text = form1.textBox1.Text; // textBox1 doit être public MaTextBox2.Text = form2.textBox2.Text; // textBox2 doit être public }
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionForm2 form2 = new Form2(); form2.textBox2.Text = textBox1.Text; form2.ShowDialog();