I have a control on my GUI which I would like to make visible only case when I run BackgroundWorkers (many different operations). Some of these operations last less than 500ms, and I feel that making the control visible for so short a time is useless. Therefore, I would like to make the control visible only if a BackgroundWorker has already been working for 500ms.
Just start a timer at the same time you start the BGW:
private void button1_Click(object sender, EventArgs e) {
timer1.Enabled = true;
backgroundWorker1.RunWorkerAsync();
}
private void timer1_Tick(object sender, EventArgs e) {
timer1.Enabled = false;
myControl1.Visible = true;
}
private void backgroundWorker1_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) {
timer1.Enabled = myControl1.Visible = false;
}