Form frm = new Form2();
Form2 frm = new Form2();
Form frm = new Form2(); (frm as Form2).ChangeTexte("Toto");
// Dans form2 public void ChangeText(string txt) { textBox1.Text = txt; } // Dans une autre form { Form frm = new Form2(); frm.Show(); frm.ChangeTexte("toto"); }
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionpublic void ChangeText(string txt) { textBox1.Text = txt; }
namespace Anniversaires { public partial class Form2 : Form { public Form2() { InitializeComponent(); } private void Form2_Load(object sender, EventArgs e) { } public void ChangeTexte(string txt) { textBox1.Text = txt; } } }
private void button3_Click(object sender, EventArgs e) { Form frm = new Form2(); frm.Show(); frm.BackColor = Color.Aqua; frm.ChangeTexte("Toto"); }