How do I prevent the app from terminating when I close the startup form?

后端 未结 4 878
一个人的身影
一个人的身影 2020-11-22 05:13

There is two Forms in my project : Form1 and Form2. There is a button in Form1, and what I want to do is closing Form1 and showing Form2 when that button clicked.

Fi

4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-22 05:26

    You can take this way:

    form2 f2=new form2()
    this.Hide();
    f2.Show();
    

    Hope it was helpful.

提交回复
热议问题