Printer p = new Printer();
// Now make the thread.
Thread backgroundThread =
new Thread(new ThreadStart(p.PrintNumbers));
backgroundThread.Name = "Secondary";
backgroundThread.Start();
// Do some additional work.
new Form1().Show();
请问我这段代码中的Form1为什么没能正常显示出来
// Now make the thread.
Thread backgroundThread =
new Thread(new ThreadStart(p.PrintNumbers));
backgroundThread.Name = "Secondary";
backgroundThread.Start();
// Do some additional work.
new Form1().Show();
请问我这段代码中的Form1为什么没能正常显示出来
你断点看看,是否执行了哪一句?
new Form1().Show();替换为:Application.Run(new Form1());
new System.Threading.Thread((System.Threading.ThreadStart)delegate
{
Application.Run(new Form1());
}).Start();