title: C#: How to avoid TreeNode check from happening on a double click event
body: <p>So I have a TreeView in a C# windows form app. What I need is for some nodes to be "locked" so that they cannot be checked (or unchecked), based on a parameter.</p>
  
  <p>What I am doing now is this:</p>
  
  <pre><code>private void tv_local_BeforeCheck(object sender, TreeViewCancelEventArgs e) {
      TNode node = (TNode)e.Node;
      //if a part node, cancel the action.
      if (node.Type == "Part") {
          e.Cancel = true;     
      }
      //if a locked node, cancel the action
      if (node.Locked == true) {
          e.Cancel = true;
      }
  }
  </code></pre>
  
  <p>This code works great on a single click of the checkbox, but if the user double clicks on a checkbox, it still checks/unchecks. </p>
  
  <p>I have tried playing with the nodeMouseDoubleClick event, but that doesnt really help, since I cannot cancel the event...</p>
  
  <p>Is there any ideas out there how to cancel a double click event on a node?... or anything else?
  Thanks</p>