簡體   English   中英

后退按鈕無法正常工作

[英]Back Button Not working properly

在父窗體我顯示多個子窗體,我打開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();
}

你可以這樣:

((this.Parent) as Window).show();

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM