title: How can I set an errorProvider against ALL invalid form controls when using this.validateChildren()?
body: <p>Apologies if I'm overlooking something obvious here. </p>
  
  <p><strong>Problem Context</strong></p>
  
  <p>I have an application which allows the user to fill out a form, the contents of which will be uploaded to a database. When they hit the 'Upload' button, the form must be validated. The user will be alerted if any fields are not valid. </p>
  
  <p><strong>Current Solution</strong></p>
  
  <p>When the user hits the button to upload the transaction, <code>validFormSelections()</code> is called. </p>
  
  <pre><code>if (!this.validateChildren())
  {
      // Display an error
      return false;
  }
  else
  {
      return true; 
  }
  </code></pre>
  
  <p>For each combobox, the validating method is called, e.g. </p>
  
  <pre><code>cmbName_Validating(object sender, CancelEventArgs e)
  {
      if (/* not valid for whatever reason */)
      {
          errorProvider.Clear();
          e.Cancel = true; 
          errorProvider.setError((Control)sender, /* suitable error message */)
      }
      else
      {
          errorProvider.SetError((Control)sender, ""); 
      }
  } 
  </code></pre>
  
  <p><strong>Problem</strong> </p>
  
  <p>What I'd like to do is show the <code>errorProvider</code> next to <em>all</em> fields which are not valid, however at the moment since <code>e.Cancel = true;</code> in an individual validation method, then (if my understanding is correct) it does not continue validating other fields once the first invalid field is found. </p>
  
  <p>How can I make it so that I can call <code>this.validateChildren()</code> and still show an <code>errorProvider</code> next to all invalid fields? </p>
  
  <p><strong>Attempts at researching a solution so far</strong> </p>
  
  <ul>
  <li><p>As far as I understand it, my problem is needing to set the <code>CancelEventArgs</code>' <code>Cancel</code> property to true, because it 'cuts off' the rest of the validation. So, it would be a good idea to find a way to avoid setting this property until later or find a way around this. But I'm not sure how to go about doing that. </p></li>
  <li><p>One of my initial thoughts was that I could solve this fairly easily if only I could return a <code>boolean</code> from each validating event handler (however I suspected, and have since learned, that I cannot do that). I see an alternative to return values in event handlers is to pass in a mutable value (such as, for example, <code>CancelEventArgs</code> itself). This seems like it could perhaps be a suitable solution, however I'm not sure how I can do this myself... </p></li>
  </ul>