private void Button_Click(object sender, EventArgs e)
        {
            Child1 c1 = new Child1();
            c1.MdiParent = this;
            c1.Show();
            this.TextBox.Text = c1.TextBox1_text;
        };
-------------------你这样当然显示不了,你的子窗体不是刚显示出来嘛。你应该在 Button1 点击事件里 往父窗体里写

解决方案 »

  1.   

    这个问题 最好的办法是用委托 我给你个写法 希望你能看明白
    child1中
    public delegate void returnvalue( int i );//类型可自己定义
    public returnvalue ReturnValue;private void button1_Click(object sender, System.EventArgs e)
    {
    if ( ReturnValue != null )
    ReturnValue( 8 );
    }
    Form中
    private void Button_Click(object sender, EventArgs e)
    {
         Child1 c1 = new Child1();
         c1.MdiParent = this;
         c1.ReturnValue+=new Child1.returnvalue(showvalue);
         c1.Show();
    }
    private void showvalue( int i )
    {
    textBox1.Text = i.ToString();
    }
      

  2.   

    子窗体不是刚显示出来嘛。你应该在 Button1 点击事件里 往父窗体里写,代码如下:
    子窗体:
    public delegate void returnvalue( int i );//类型可自己定义
    public returnvalue ReturnValue;private void button1_Click(object sender, System.EventArgs e)
    {
    if ( ReturnValue != null )
    ReturnValue( 8 );
    }父窗体:
    private void Button_Click(object sender, EventArgs e)
    {
         Child1 c1 = new Child1();
         c1.MdiParent = this;
         c1.ReturnValue+=new Child1.returnvalue(showvalue);
         c1.Show();
    }
    private void showvalue( int i )
    {
    textBox1.Text = i.ToString();
    }
      

  3.   

    最简单的办法就是在子窗体中增加一个公共属性
    public string Textbox1test
    {
    get
    {
    return Textbox1.Text;
    }
    }  private void Button_Click(object sender, EventArgs e)
            {
                Child1 c1 = new Child1();
                c1.MdiParent = this;
                c1.Show();
                this.TextBox.Text = c1.Textbox1test;
            };