How can I stop the execution of a specific method by press for example on StopButton in WinForm
<p>I have 2 buttons the first one it's name "Continuous" .. the second one "Stop"</p>

<p>I want to call a method when press the continuous button : </p>

<pre><code>private void continuous_Click(object sender ,EvantArgs e) 

 {    // how to get stop event

while(!StopEvent) method();



  }
</code></pre>

<p>my question is : how can I stop  the execution by pressing the stop button ?? </p>
