title: TreeView (with checkboxes) not processing clicks correctly?
body: <p>I've got a TreeList that's basically like a Photoshop layers palette. It's a hierarchical list with checkboxes to toggle visibility of a document's individual layers. This is done via the BeforeChecked event, which is raised right before the .Checked value toggles.</p>
  
  <p>It works fine, except if you double-click it, at which point it all seems to go haywire.</p>
  
  <p>If you double-click a checkbox once, it toggles the checked value twice (which is the intended behavior), but it doesn't toggle the visibility of the layer twice because it doesn't raise the BeforeChecked twice.</p>
  
  <p>I figured I'd get around this by putting this in the MouseDoubleClick event:</p>
  
  <pre><code>TreeViewHitTestInfo hit = treeLayerPalette.HitTest(e.X, e.Y);
  hit.Node.Checked = !(hit.Node.Checked);
  </code></pre>
  
  <p>This works for all double-clicks except for the first one. So it only raises the BeforeChecked event once (and not the MouseDoubleClick) at first, getting the checkbox out of sync with the visibility of the layer, and then all following double-clicks raise both the BeforeChecked and MouseDoubleClick events (which in turn raises the BeforeChecked event), maintaining that incorrect relationship.</p>
  
  <p>Also, at one point, I put a MessageBox.Show() in the DoubleClick event. Awkwardly enough, it does not actually get shown on a double-click, but instead gets shown on a third click, no matter how much time has elapsed between the actual double-click and the third click. A third click performed 20 seconds after a double-click will raise the MouseDoubleClick event, but the actual double-click won't.</p>
  
  <p>What's actually going on here, and how can I fix it?</p>