Billie
Billie

Reputation: 87

How to open a new independent form?

I'll start with a code:

private void button_newform_Click(object sender, EventArgs e)
    Form newF = new Form();
    newF.show();

I have a form with a button who can open a new form.

the problem is, the new form have parent.

for example, if I'll click on newform button, it will create a new form.

but when I close this form, the new form will be closed too.

how to create an independent form, from an existing form?

Upvotes: 2

Views: 2275

Answers (1)

Abdusalam Ben Haj
Abdusalam Ben Haj

Reputation: 5423

The reason this is happening is because in the project->application properties, the shutdown mode is set to When startup Form closes. Change that to When Last form closes.

Upvotes: 7

Related Questions