C# Backgroundworker keep on running DoWork
<p>Below is my coding:</p>

<pre><code>    Form2 msgForm;
    private void button3_Click_1(object sender, EventArgs e)
    {

        bw.WorkerReportsProgress = true;
        bw.WorkerSupportsCancellation = true;
        bw.DoWork += new DoWorkEventHandler(bw_DoWork);
        bw.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bw_RunWorkerCompleted);

        msgForm = new Form2();

        try
        {
            bw.RunWorkerAsync();

            msgForm.ShowDialog();
        }
        catch (Exception ex)
        {
            MessageBox.Show(ex.Message);
        }
    }

    void bw_DoWork(object sender, DoWorkEventArgs e)
    {
        // Coding that transmit protocol and will last around 2 minutes.
    }

    void bw_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
    {
        msgForm.Close();
    }
</code></pre>

<p>I use the background worker method everytime I click a button to transmit protocols that last around 2 minutes. During transmission, the From2 will show 'Please wait'.</p>

<p>But I have some problem using this coding. The problem is like, when I click the button the first time, it will transmit the protocol once. After that I click again which is the second time, it transmit the protocol twice. After that I click again which is the third time, it transmit the protocol 3 times.... And so on. The times of protocol of transmit increase each time I click the button.</p>

<p>Aren't that it will only run once the coding in void bw_DoWork everytime I click the button?</p>

<p>Is there something wrong with my coding?</p>
