private async void WPRunAllCasesButton_Click(object sender, EventArgs e) { string res = ""; foreach (Control c in WelcomePanel.Controls) { c.Enabled = false; } await Task.Run(() => { res = TestCaseManager.RunAllTestCases(); }); MessageBox.Show(res); foreach (Control c in WelcomePanel.Controls) { c.Enabled = true; } }