title: .NET Treeview doesn't send click event on empty control
body: <p>I'm working with a .NET Treeview control (not WPF, but regular winforms) and am having trouble with the right-click event (or any click event) not firing when the control has no nodes inside of it.  As per the response to <a href="https://stackoverflow.com/questions/2527/c-treeview-context-menus/2546#2546">another thread</a> on Stackoverflow, my event handler code is as follows:</p>
  
  <pre><code>    private void tvTest_MouseClick(object sender, MouseEventArgs e)
      {
          // Note: this block below is needed so that the menu appears on
          // the correct node when right-clicking.
          if (e.Button == MouseButtons.Right)
          {
              tvTest.SelectedNode = tvTest.GetNodeAt(e.X, e.Y);
              if (tvTest.SelectedNode != null)
              {
                  tvTestContextMenuStrip.Show(tvTest, e.Location);
              }
              else
              {
                  tvTestContextMenuStrip.Show(tvTest, tvTest.Location);
              }
          }
      }
  </code></pre>
  
  <p>The problem comes in that while this works fine when nodes are present, if the control is empty, I can't right-click the control and choose "add a node" to add to the root.  The handler isn't entered AT ALL, as I set a breakpoint right at the beginning, and it appears the method is never entered.</p>
  
  <p>Does anybody know how to get "something" to happen when the Treeview is empty?</p>