I have a button to set the bool to false and then he shouldn't upload the files anymore automatic. But if I set it to true again, he should start to upload it his own, but it he doesn't.
private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
{
while (automaticUpload)
{
//I do something here
}
}
I set it to true using a button click
private void oNToolStripMenuItem_Click(object sender, EventArgs e)
{
automaticUpload = true;
}
Edit:
I know I have to start the backgroundworker ^^ Or do you mean calling EnableUpload() again with the button click ?
private void EnableUpload()
{
backgroundWorker1.RunWorkerAsync();
}