(一)本例的功能是:
Form1中Label1,button1--启动Form
Form2中TextBox2,button2--被调用Form
(二)实施过程如下:
在Form2中设置一个变量 public  Form1 parent;
(1)Form1 的buttonClick事件
private void button1_Click(object sender, System.EventArgs e)
  {
   Form2 form2=new Form2();
   form2.parent=this;
   form2.ShowDialog();
  }

(2)Form2 的buttonClick事件
private void button1_Click(object sender, System.EventArgs e)
  {
   this.parent.label1.Text=this.textBox2.Text;
   this.Close();
  }

 

posted on 2004-07-13 14:46  apple  阅读(782)  评论(0编辑  收藏  举报