Enable/Disable buttons while thread is working

I have a button that starts two threads

private void CrawdBtn_Click(object sender, EventArgs e)
{
    CrawdBtn.Enabled = false;
    t = new Thread(AddLinksToList);
    b = new Thread(EnqueueFromList);
    t.Start();
    b.Start();            
}

and there are another buttons to pause, Resume, Stop those threads My question is how can I disable (pause, Resume, Stop) buttons while the threads are working and re enable Crawl after the threads finished

Answer

Here is how you could start a Thread and have a way to await its completion:

public static Thread CreateAwaitableThread(Action action, out Task threadCompletion)
{
    var tcs = new TaskCompletionSource<bool>();
    threadCompletion = tcs.Task;
    return new Thread(() =>
    {
        try
        {
            action();
        }
        finally
        {
            tcs.SetResult(true);
        }
    });
}

This method returns the newly created Thread, and also a Task that will be completed when the Thread is completed. You could use it like this:

private async void CrawdBtn_Click(object sender, EventArgs e)
{
    CrawdBtn.Enabled = false;
    Thread t1 = CreateAwaitableThread(AddLinksToList, out var t1c);
    Thread t2 = CreateAwaitableThread(EnqueueFromList, out var t2c);
    t1.Start();
    t2.Start();
    await Task.WhenAll(t1c, t2c);
    CrawdBtn.Enabled = true;
}

In case of an exception the error will not be propagated through the Task. It is assumed that the delegates already include error handling logic. If not, an unhandled exception will occur as usual.