I'm have a Form1 and when I run a loop I need to open another form(Form2). The problem is that when I run the loop it shows the Form2 only for the first time, then the Form2 is opened and close automatically.
To probe it I wrote this simple code but it doesn't work:
Form2 reg = new Form2();
while (true)
{
reg.ShowDialog();
}
In Form2:
private void button1_Click(object sender, EventArgs e)
{
Application.Exit();
}
Thanks for any help!