Hi
I am opening a new form by:
ChooseLeve chl = new ChooseLevel();
chl.owner = this;
chl.close;
i want that when the user clicks on button1 in chl (ChooseLevel), the preiouse form will be closed,
how do i do it?
Open new form and closing the previous one
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
bod9 pointsPosted Mar 7, 2006, 4:05 AM EST
I'm not expert, but could you do it this way:
ChooseLeve chl = new ChooseLevel();
chl.showdialog();
this.hide();
jon6 pointsPosted Mar 7, 2006, 2:26 PM EST
have you tried
private void ButtonClick()
{
Application.Run(new Form2());
this.Close();
}
Form2 will have no owner, so when Form1 closes it wont cleanup Form2. Secondly because the application still has something to process (Form2) it will continue happily..