title: Combine a number of groupboxes into a single searchable variable
body: <p>I'm making a Windows Form Application with C#.</p>
  
  <p>One of my forms contains 5 group boxes, each containing 6 checkboxes inside.
  I need to count all the checked checkboxes.</p>
  
  <p>At the moment I have coded it as follows:</p>
  
  <p><code>int NumOfRacks1 = groupBoxPace.Controls.OfType&lt;CheckBox&gt;()
                              .Count(cb =&gt; cb.Checked);</code></p>
  
  <p>However I would have to repeat the above 5 times and then add all the variables together to get an answer. I'm sure there is a smarter way to do this which cuts down the code.</p>
  
  <p>I tried to combine three of them as follows:</p>
  
  <p><code>var allRacks = groupBoxSamsung.Controls.OfType&lt;CheckBox&gt;().Concat(groupBoxPace.Controls.OfType&lt;CheckBox&gt;().Concat(groupBox780.Controls.OfType&lt;CheckBox&gt;()));</code></p>
  
  <p>But this didn't work as expected.</p>
  
  <p>Does anyone know of a way to achieve this?</p>