0

在父表单中,我正在显示多个子表单,我正在打开child2 from child1child3 from child2直到它工作正常并且表单在父表单中打开,但是当我想从父表单之外返回时child2 to child1child1 form什么是正确的代码对于后退按钮?

打开的代码chil2 form写在child1 form

private void btnEngClgList_Click(object sender, EventArgs e) {
    ShowEngClgList engfrm = new ShowEngClgList(LoginName);
    engfrm.MdiParent = this.ParentForm;
    this.Hide();
    engfrm.Show();
}

编写的后退按钮代码child2 Form

private void toolStripBtnBack_Click(object sender, EventArgs e) {
    this.Close();
    MainForm mnfrm = new MainForm(lname);
    mnfrm.MdiParent = this.ParentForm;
    mnfrm.Show();
}
4

1 回答 1

0

你可以这样做:

((this.Parent) as Window).show();
于 2013-09-06T05:48:07.367 回答