关闭当前窗口,打开另一窗口

namespace CloseOpen { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { System.Threading.Thread thread = new System.Threading.Thread(new System.Threading.ThreadStart(NewForm)); thread.Start(); while (thread.ThreadState != System.Threading.ThreadState.Running) ; this.Close(); } private void NewForm() { Application.Run(new Form2()); } } }

 

 

你可能感兴趣的:(窗口)