title: cancel MouseDown event in WinForms app
body: <p>I've several count variables with min and max values. While I press the appropriate buttons the counter goes up or down.</p>
  
  <p>While pressing the lmb and the counter exceeds e.g. 100 (max value) it doesnt stop counting naturally.</p>
  
  <p>Is there  a way to check my counter and force the end of the mouse event without watching over it manually?</p>
  
  <pre><code>private void button_RunXPositive_MouseDown(object sender, MouseEventArgs e)
  {
      if (X &lt; 100) {
        StartInMode(0, true); // a motor 
        ((Button_Triangle)sender).BackColor = ((Button_Triangle)sender).EdgeColor;
        return;
      }  
      else {
        ((Button_Triangle)sender).BackColor = Color.Black;
        this.MotorStop((UInt32)0);
      }
  }
  </code></pre>