2

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?

shf301
  • 31,086
  • 2
  • 52
  • 86
Billie
  • 77
  • 1
  • 1
  • 6

1 Answers1

7

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.

Abdusalam Ben Haj
  • 5,343
  • 5
  • 31
  • 45