How to check completion of thread
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);
}
}