title: C# Stop a Treeview selecting one or more TreeNodes
body: <p>I have a TreeView control showing multiple TreeNodes in an organised heirarchy. I want to stop the user selecting the highest level Nodes (this was achieved by using the BeforeSelect Event). I also want to stop the TreeView from highlighting the top level nodes if the user selects them i.e. stop the TreeView from changing the background color of the node and 'selecting' it.</p>
  
  <p>The TreeView that I am using is the WinForms version of the control.</p>
  
  <p>Below is the source code I am currently attempting to use:</p>
  
  <pre><code>private void tree_BeforeSelect ( object sender, TreeViewCancelEventArgs e )
  {
      if ( e.Node.Level == 0 )
      {
          e.Cancel = true;
      }
  }
  </code></pre>
  
  <p>This does de-select the Node but only after a noticible flash (~200ms) which is undesirable.</p>