Hidden form not closing

前端 未结 2 1468
一整个雨季
一整个雨季 2020-12-04 03:16

I have a C# Form, where you have Form1 shown at the start, and when you press Go you are taken to Form2. Form1

2条回答
  •  天涯浪人
    2020-12-04 03:59

    Use the FormClosed event on Form2 to exit the application.

    private void Form2_FormClosed(object sender, FormClosedEventArgs e)
    {
         Application.Exit();
    }
    

提交回复
热议问题