title: Un-/Check behavior in C# TreeView
body: <p>I found a lot about treeview and checkboxes in treeviews...</p>
  
  <p>but one thing seems to be undiscussed.</p>
  
  <p>I have my treeview like</p>
  
  <pre><code>[x] Foo
   L [x] One
   L [x] Two
   L [x] Three
  [x] Bar
   L [ ] One
   L [x] Two
   L [x] Three
  [ ] Hello
   L [ ] One
   L [ ] Two
   L [ ] Three
  </code></pre>
  
  <p>Now when I check my parent checkbox e.g. <code>Foo</code> than all child get selected. Also they get deselected by unchecking <code>Foo</code>. To do this I have this Method</p>
  
  <pre><code>private void TreeView1_AfterCheck(object sender, TreeViewEventArgs e)
  {
      foreach (TreeNode childNode in e.Node.Nodes)
      {
          childNode.Checked = e.Node.Checked;
      }
  }
  </code></pre>
  
  <p>I tried a lot with using <code>count</code> and others but could not achive what i'm trying to achive.</p>
  
  <p>So what I want is, when I check <code>Two</code> in TreeNode <code>Hello</code> than <code>Hello</code> should get checked. Without checking <code>One</code> and <code>Three</code>. Check-/Unchecking <code>Hello</code> should select/deselect all childs.</p>
  
  <p>Is this even possible?</p>
  
  <p>Because when <code>Hello</code> gets checked, it fires the <code>TreeView1_AfterCheck</code>-event! What actually check/unchecks all childs.</p>
  
  <p>And most of my tries ended up in an endless loop.</p>
  
  <p>So my Question actually is: </p>
  
  <p>Can I achive the above described behavior? </p>
  
  <p>Ask me if something is unclear.</p>