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?
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
jonPosted Mar 7, 2006, 7:26 PM
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..
bodPosted Mar 7, 2006, 9:05 AM
I'm not expert, but could you do it this way:
ChooseLeve chl = new ChooseLevel();
chl.showdialog();
this.hide();