界面二关闭的时候数据传回界面一
界面一
string cc= string.Empty;
private void button1_Click(object sender, EventArgs e)
{
Form2 f2 = new Form2();
f2.ShowDialog();
if (f2.DialogResult == DialogResult.OK)
{
this.textBox1.Text = f2.str;
}
}
界面二
public string str;
public string Str
{
get { return this.str; }
}
private void button1_Click(object sender, EventArgs e)
{
str = this.textBox1.Text;
this.DialogResult = DialogResult.OK;
}