omicito omicito - 2 months ago 7
C# Question

C# when opening new form, old one has to stop

I have new form opening when button is clicked, like this:

private void button8_Click(object sender, EventArgs e)
{
Form2 form2 = new Form2();
form2.ShowDialog();
//more code
}


Does this mean that, when i click Button8, form2 will be opened, but code after form2.ShowDialog() will not be executed until i close form2?

If this is not the way how to do that, please, can you tell me.

Answer

Use Show(); not ShowDialog(); That should works.

Comments