frm2 f2=new frm2()
f2.ShowDialog();
f1.strA = f2.strA;
f2.Dispose();

解决方案 »

  1.   

    1.把需要共享的数据设置为static 类型,不过这样有个缺点,就是该数据变成静态的了... 这种方法尽量少用
    2.把FORM1 当作参数传给FORM2,FORM2的声明可以这么写:
    class Form2:Form
    {
        Form1 f1;
        public Form2(Form1 fm1)
        {
            f1=fm1;
        }    void fun()
        {
            //用的时候在这里f1.textBox1.Text=this.textBox1.Text;
        }
    }
      

  2.   

            private void button1_Click(object sender, EventArgs e)
            {
                Form2 frm = new Form2();
                frm.ShowDialog();            MessageBox.Show(frm.Tag.ToString());
            }        private void button1_Click(object sender, EventArgs e)
            {
                this.Tag = "我要关闭了";
                this.Close();
            }