弹出form2
private void button3_Click(object sender, EventArgs e)
{
Form2 frm = new Form2();
frm.Owner = this;
frm.Show();
}
form2里单击添加按钮就写回到form1的textbox1里
private void button1_Click(object sender, EventArgs e)
{
Form1 frm1;
frm1 = (Form1)this.Owner;
frm1.textBox1.Text = textBox1.Text;
}
public pritial class Form1:Form
{
public Form1()
{
InitCompoment();
}
public void button1_Click(object sender,EventArgs e)
{
Form2 fm = new Form2();
if (fm.DialogResult == DialogResult.OK)
{
this.label.Text = fm.tbText.Text;
}
}
}