checkerThread = new Thread(new ThreadStart(() => CheckTokens()));
checkerThread.Start();
// Re-enable controls when done
stopCheckButton.Visible = false;
stopCheckButton.Enabled = false;
startCheckButton.Enabled = true;
loadTokenListButton.Enabled = true;
exportTokensButton.Enabled = true;
clearCheckButton.Enabled = true;
clearValidButton.Enabled = true;
tokenInputBox.Enabled = true;
When the thread is running controls are disabled in my Form. I want to re-enable them when the thread is done. How would I do that without blocking the UI by thread.Join()?
asyncas a keyword, it's inherent in the operation being asynchronous, which is necessary to not block the UI, even if you use some other form of asynchrony.