Pause thread and resume while clicking resume button
<p>I am using a thread to download files. When i click a button i have to pause the download and when clicking another button i have to resume download. I used EventWaitHandle to pause. But i cannot access other button to vall Set method for resuming. Please help. The code for pausing download is given below</p>

<pre><code> private void BtnStopDownload_Click(object sender, EventArgs e)
 {
     myWaitHandle = new EventWaitHandle(false, EventResetMode.ManualReset);
     WaitState = true;
     myWaitHandle.WaitOne();
 }
</code></pre>
