[c# 2.0] Comment modifier un string d'un Form depuis un autre Form ?
Bonjour,
J'ai déclaré un string dans mon Form1, et je souhaite modifier ce string depuis une Form2.
Comment faite ?
Merci
Tintin92
Mon code qui ne compile pas.
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
| public partial class Form1 : Form
{
public string strTest;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Form2 frm = new Form2();
frm.Show();
} |
Code:
1 2 3 4 5
|
private void button1_Click(object sender, EventArgs e)
{
Form1.strTest = textBox1.Text;
} |