参考
form1上代码
private void button1_Click(object sender, EventArgs e)
{
Form2 f2 = new Form2();
f2.Owner = this;
f2.ShowDialog();
}
public void test(string txt)
{
textBox1.Text = txt;
}
form2上代码
private void button1_Click(object sender, EventArgs e)
{
Form1 f1 = (Form1)this.Owner;
f1.test(textBox1.Text);
this.Close();
}