[英]Back Button Not working properly
在父窗體我顯示多個子窗體,我打開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();
}
你可以這樣:
((this.Parent) as Window).show();
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.