title: How to cancel winform button click event?
body: <p>I have a custom button class inherited from System.Windows.Forms.Button.</p>
  
  <p>I want to use this button in my winform project.</p>
  
  <p>This class is called "ConfirmButton", and it shows confirm message with Yes or No.</p>
  
  <p>But the problem is that I do not know how to stop click event when user selected No with confirm message.</p>
  
  <p>Here is my class source.</p>
  
  <pre><code>using System;
  using System.ComponentModel;
  using System.Windows.Forms;
  
  namespace ConfirmControlTest
  {
      public partial class ConfirmButton : System.Windows.Forms.Button
      {
          public Button()
          {
              InitializeComponent();
  
              this.Click  += Button_Click;
          }
  
          void Button_Click(object sender, EventArgs e)
          {
              DialogResult res    = MessageBox.Show("Would you like to run the command?"
                  , "Confirm"
                  , MessageBoxButtons.YesNo
                  );
              if (res == System.Windows.Forms.DialogResult.No)
              {
                  // I have to cancel button click event here
  
              }
          }
      }
  }
  </code></pre>
  
  <p>If user select No from confirm message, then the button click event should not fire anymore.</p>