title: If checkbox checked do something else uncheck
body: <p>I am trying to create an if statement to prompt me asking if i am sure i want to check the checkbox. If the checkbox is already checked to just uncheck the box. Below is what i have an cant seem to get to work. Thanks! if anyone has a simple way of doing this please advise.</p>
  
  <pre><code>if (checkBox15.Checked == false)
  {
      MessageBox.Show("Are you sure you want to check this?", "Prompt", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
      { 
          Updatelist(); 
      } 
      else
      {
          checkBox15.Checked = false;
          return;
      }  
  }
  else  if (checkBox15.Checked == true)
  {
      checkBox15.Checked = false;
      return;
  } 
  </code></pre>