我需要帮助创建一个线程,C#
winforms
private void button1_Click(object sender,EventArgs e) { Thread t=new Thread(new ThreadStart(Start)).Start(); } public void Start() { MessageBox.Show("Thread Running"); }
我一直收到这条消息:
Cannot implicitly convert type 'void' to 'System.Threading.Thread
怎么做msdn文档是没有用的
解决方法
这可行:
Thread t = new Thread (new ThreadStart (Start)); t.Start();
这也可行:
new Thread (new ThreadStart(Start)).Start();
MSDN文档很好而且正确,但是你做错了.