Disable the cancel button when already pressed.

This commit is contained in:
AJ
2019-11-14 13:50:10 -05:00
parent ceb69c7a27
commit 2edea0cb65

View File

@@ -89,12 +89,15 @@ namespace ExportDXF.Forms
{ {
if (worker.IsBusy) if (worker.IsBusy)
{ {
button1.Enabled = false;
worker.CancelAsync(); worker.CancelAsync();
return; return;
} }
else
{
worker.RunWorkerAsync(); worker.RunWorkerAsync();
} }
}
private void button2_Click(object sender, EventArgs e) private void button2_Click(object sender, EventArgs e)
{ {
@@ -146,6 +149,7 @@ namespace ExportDXF.Forms
comboBox1.Enabled = true; comboBox1.Enabled = true;
button1.Image = Properties.Resources.play; button1.Image = Properties.Resources.play;
button1.Enabled = true;
})); }));
var duration = DateTime.Now - timeStarted; var duration = DateTime.Now - timeStarted;