thread for method with return value in C#
<p>Delay.cs</p>

<pre><code>using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;

namespace LearnThread
{
    class Delay
    {
        public int Convert()
        {
            int ErrorCode = 1;
            //something
            //takes long time. about 9 hours.
            return ErrorCode;
        }
    }
}
</code></pre>

<p>Form1.cs</p>

<pre><code>using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Threading;

namespace LearnThread
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void btnStart_Click(object sender, EventArgs e)
        {
            Delay delay = new Delay();
            Thread t = new Thread(delay.Convert);
            //something
            MessageBox.Show("Success");
        }
    }
}
</code></pre>

<p>Delay delay = new Delay(); is error here as it is expecting return value. I want the return value as it is contains errorcode. How can I do that? Background worker is better than Thread? Please help. (I should not lose control on the form when delay.Convert() is running.)</p>
