在父表单中,我正在显示多个子表单,我正在打开child2 from child1
,child3 from child2
直到它工作正常并且表单在父表单中打开,但是当我想从父表单之外返回时child2 to child1
,child1 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();
}