If you want a threadpool thread you could do this:
private delegate void MyDelegate(string text);
private void button6_Click(object sender, System.EventArgs e)
{
// Fire a simple method on the thread pool with no args and void return
using a system defined delegate.
new System.Windows.Forms.MethodInvoker(DoThis).BeginInvoke(null, null);
// Fire a custom delegate on the thread pool with user defined delegate.
new MyDelegate(DoThat).BeginInvoke("Delegates are fun.", null, null);
}
private void DoThis()
{
Console.WriteLine("Did this.");
Console.WriteLine("Is Thread Pool?:" +
Thread.CurrentThread.IsThreadPoolThread);
}
private void DoThat(string text)
{
// Also call EndInvoke.
Console.WriteLine("Did that:"+text);
Console.WriteLine("Is Thread Pool?:" +
Thread.CurrentThread.IsThreadPoolThread);
}