Back Button Not working properly
In parent form I am displaying multiple child forms ,I am opening child2
from child1,child3 from child2 till this it is working fine and form are
getting open in parent form, but when I want to go back from child2 to
child1 than child1 form is getting open outside parent form ,what can be
right code for back button ?
code for opening chil2 form written in child1 form
private void btnEngClgList_Click(object sender, EventArgs e)
{
ShowEngClgList engfrm = new ShowEngClgList(LoginName);
engfrm.MdiParent = this.ParentForm;
this.Hide();
engfrm.Show();
}
back button code written in child2 Form
private void toolStripBtnBack_Click(object sender, EventArgs e)
{
this.Close();
MainForm mnfrm = new MainForm(lname);
mnfrm.MdiParent = this.ParentForm;
mnfrm.Show();
}
No comments:
Post a Comment