I need help in creating a thread, 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");
}
I keep getting this message:
Cannot implicitly convert type 'void' to 'System.Threading.Thread
what to do the msdn documentation is no good
This would work:
And this would work as well:
The MSDN documentation is good and correct, but you're doing it wrong. :) You do this:
So, what you do here in fact, is try to assign the object that is returned by the Start() method (which is void) to a Thread object; hence the error message.