/// <summary> /// Windows Form Closing. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void FormSettings_FormClosing(object sender, FormClosingEventArgs e) { if (WorkerLoad.IsBusy) { ButtonCancel.Enabled = false; WorkerLoad.CancelAsync(); e.Cancel = true; } if (WorkerSave.IsBusy) { ButtonCancel.Enabled = false; WorkerSave.CancelAsync(); e.Cancel = true; } if (WorkerReset.IsBusy) { ButtonCancel.Enabled = false; WorkerReset.CancelAsync(); e.Cancel = true; } }