One more Logic you can apply for background processing using worker thread. It is more prominent to maintain state of button like in this manner
BackgroundWorker Operation = new BackgroundWorker();
Operation.DoWork += new DoWorkEventHandler(Operation_DoWork);
Operation.RunWorkerCompleted += new RunWorkerCompletedEventHandler(Operation_RunWorkerCompleted);
Operation.RunWorkerAsync();
and in the event you can apply yours logic
void Operation_DoWork(object sender, DoWorkEventArgs e){
button1.enable = false;
}
and if it is completed in background then implement this event
void Operation_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
{
button1.enable = true;
}
I hope you like it