在form1里菜单点击修改,弹出form2,然后在form2中的textbox中输入,怎么获得textbox中的数据然后返回到form1中?![c# 弹出输入框 c# 弹出输入框](https://www.codebye.com/wp-content/uploads/2016/07/6487293141534786187.jpg)
![c# 弹出输入框 c# 弹出输入框](https://www.codebye.com/wp-content/uploads/2016/07/6487293141534786187.jpg)
解决方案
20
public class Form2 : Form{ .... public string Result{ get{return textBox1.Text;} } private void 确定_Click(object sender,EventArgs e){ this.DialogResult = DialogResult.OK; } } public class Form1 : Form{ .... Form2 frm = new Form2(); if(frm.ShowDialog() == DialogResult.OK){ MessageBox.Show(frm.Result); } }