I want to enable button4 once all the if conditions in GoCheck fuction is completed
private void button4_Click(object sender, EventArgs e)
{
try
{
button4.Enabled = false;
Thread t1 = new Thread(GoCheck);
t1.IsBackground = true;
t1.Start();
}
catch
{
MessageBox.Show("Critical Error Check Input Files");
}
}
private void GoCheck()
{
try
{
//----CODE--------------------------------------------
//----CODE--------------------------------------------
//----CODE--------------------------------------------
//----CODE--------------------------------------------
if (duplicates_1.Count == 0 && duplicates.Count == 0 && asList.Count == 0)
{
MessageBox.Show("Input Successfully Verified");
}
}
catch
{
MessageBox.Show("Check Input File and Restart");
Environment.Exit(0);
}
}
Loading

VulpesPosted Jul 9, 2014, 6:16 AM
this.Invoke((Action)(() => button4.Enabled = true));
Farhan ShariffPosted Jul 9, 2014, 6:55 AM
Guest UserPosted Jul 9, 2014, 5:51 AM