What should I report to report progress in the backgroundworker DoWork event?
<p>This is the code:</p>

<pre><code>private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
        {
            BackgroundWorker worker = sender as BackgroundWorker;
            while (true)
            {

                if ((worker.CancellationPending == true))
                {
                    e.Cancel = true;
                    break;
                }
                else
                {
                    if (tempCpuValue &gt;= (float?)nud1.Value || tempGpuValue &gt;= (float?)nud1.Value)
                    {
                        soundPlay = true;
                        blinking_label();
                        NudgeMe();
                    }
                    else
                    {
                        soundPlay = false;
                        stop_alarm = true;

                    }
                    backgroundWorker1.ReportProgress(
                }
            }
        }
</code></pre>

<p>What should i put or use here: <code>backgroundWorker1.ReportProgress</code>(
I dont have any progress bar or something. How should i do it ?</p>

<p>Before that the DoWork event was like this:</p>

<pre><code>private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
        {
            BackgroundWorker worker = sender as BackgroundWorker;
            while (true)
            {

                if ((worker.CancellationPending == true))
                {
                    e.Cancel = true;
                    break;
                }
                else
                {
                    if (tempCpuValue &gt;= (float?)nud1.Value || tempGpuValue &gt;= (float?)nud1.Value)
                    {
                        soundPlay = true;
                        blinking_label();
                        NudgeMe();
                    }
                    else
                    {
                        soundPlay = false;
                        stop_alarm = true;

                    }
                    cpuView();
                    gpuView();
                    //Thread.Sleep(1000);
                }
            }
        }
</code></pre>

<p>Where inside cpuView() i have:</p>

<pre><code>this.Invoke(new Action(() =&gt;
                                {
                                    data = new List&lt;string&gt;();
                                    data.Add("Gpu Temeprature --- " + sensor.Value.ToString());
                                    listBox1.DataSource = null;
                                    listBox1.DataSource = data;
                                    listBox1.Invalidate();
                                }));
</code></pre>

<p>So i thought that the proper way was to use a progrees report and in the progress report event to use this listBox updates . Instead of calling the cpuView and gpuView in the DoWork event. </p>
