在窗口中有:
private void pictureBox2_Click(object sender, System.EventArgs e)
{
this.Hide();
(new CardForm()).Show(); 
}
在CardForm窗口中按下一个返回按钮,如何使主窗口再次显示出来?谢谢

解决方案 »

  1.   

    this.Hide();
    CardForm cardForm = new CardForm();
    cadForm.Closed += new EventHander(this.CardFormClosed)
    cardForm.Show();............
    void CardFormClosed(object Sender,EventAgrs arg)
    {
        this.Show();
    }
      

  2.   

    this.Hide();之前可以先把this保存在一个public static对象中也可以在CardForm构造方法加以个参数把this传递过去,在CardForm中控制你的主窗体
      

  3.   

    2种方法。
    1-new CharForm(this),在CharForm中保存主窗体的引用,这样可以在CharForm中Show()主窗体
    2-为CharForm定义一个事件比如叫onClickButton,然后在初窗体类中订阅该事件:
    CharForm cf = new CharForm();
    cf.onClickButton += new OnClickButtonHandler(this.Func1);void Func1()
    {
      this.Show();
    }