Using a timer in a background worker is kinda pointless. If you want to do something repeatedly, you should just use a loop iinside the backgroundworker DoWork() method. Here's some rough code:
private void DoWork(object sender, DoWorkEventArgs e)
{
BackgroundWorker worker = sender as BackgroundWorker;
int delay = 1000;
while (!worker.CancellationPending)
{
do something
Thread.Sleep(delay);
}
e.Cancel = true;
}
If you need a delay longer than 1 second, your loop will have to change a little to allow you tpo detect whether or not the worker has been closed:
int delay = 1000;
int interval = 60000;
int elapsed = 0;
while (!worker.CancellationPending)
{
elapsed = 0;
do something
while (elapsed < interval && !worker.CancellationPending)
{
Thread.Sleep(delay);
}
}
e.Cancel = true;