本文转自:https://blog.csdn.net/GrandShaw/article/details/53074122 新建一个windows窗体 Form2 ,Form2里也有一个按钮和一个TextBox控件,在TextBox里输入你想要的返回值。 Form1里: private void button1_Click(object sender, EventArgs e) { Form2 f2 = new Form2(); f2.ShowDialog(); if (f2.DialogResult == DialogResult.OK) { this.textBox1.Text = f2.str; } } Form2里: 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; } 这种是传值后Form2关闭的,还有一种是传值后Form2不关闭的。 Read More