注意当前窗口是主窗口,不说什么this.close()  this.hide() 什么的
如果close的话 那所有窗口都关了 hide的话 关闭第二个的时候 程序还在运行
第二个窗口的关闭代码应该写在那里 第二个窗口没有关闭按钮 只能按那个X

解决方案 »

  1.   

    using System.Threading;Thread th=new Thread(delegate(){new YourForm().ShowDialog();});
    th.Start();结贴率:0.00%
      

  2.   

    Application.Run(new Form1());
    Application.Run(new Form2());这样第一个关闭了第二个接着运行..
      

  3.   

    可以使用thread或者是那个backgroundworker。
      

  4.   

            private void Button1_Click(object sender, EventArgs e)
            {
                System.Threading.Thread thrT = new System.Threading.Thread(new System.Threading.ThreadStart(NewForm));
                thrT.Start();
                while (thrT.ThreadState != System.Threading.ThreadState.Running) ;
                this.Close();
            }        private void NewForm()
            {
                Application.Run(new Form2());
            }