title: TreeView double-click behaviour in .NET / C#
body: <p>I have a regular .NET <a href="http://en.wikipedia.org/wiki/Windows_Forms" rel="noreferrer">Windows Forms</a> treeview control. The nodes are setup like this:</p>
  
  <p>Group</p>
  
  <p>---child</p>
  
  <p>---child</p>
  
  <p>If I double-click a collapsed Group node, it expands (as you'd expect) and the NodeMouseDoubleClick event is fired off, where my code does something if the selected node is NOT a group node.</p>
  
  <p>The problem arises when the Group is located near the bottom of the treeview, so that when I double-click the Group node it would require the treeview to expand vertically to fit the child nodes into view. In such cases, if I double-click the Group node, by the time it expands and adjusts the treeview, my mouse cursor is over a child node (it had to push everything up), and that causes the NodeMouseDoubleClick to think the child node is selected, which causes very odd behaviour.</p>
  
  <p>How can I get around this?  Should I not be using NodeMouseDoubleClick or..?</p>
  
  <p>I see it was also explained in the feedback report <em><a href="http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=304958" rel="noreferrer">Problem with TreeView DoubleClick event after expanding/collapsing caused change of scroll</a></em>.</p>