title: Treeview issue while renaming the node
body: <p>Hi all i have written a code to rename the node of a treeview. While editing if i erase all the text and hit enter it is getting renamed but if the user enter some text with an extensioin .txt then only i would like to rename that name.</p>
  
  <p>I debugged my solution erasing all the text gives "" so that it is not checking the condition what to do to raise an error message if it is left as that i specify</p>
  
  <p>This is my code</p>
  
  <p>//Contextmenu </p>
  
  <pre><code>   private void renameToolStripMenuItem_Click(object sender, EventArgs e)
      {
          string strOld = treeViewACH.SelectedNode.ToString();
          treeViewACH.SelectedNode.BeginEdit();
  
      }
  </code></pre>
  
  <p>//To show the context menu on the selected node</p>
  
  <pre><code>    private void treeViewACH_MouseDown(object sender, MouseEventArgs e)
      {
          if (e.Button == MouseButtons.Right)
          {
  
  
              if (treeViewACH.SelectedNode.Parent != null)
              {
                  string strSwitch = treeViewACH.SelectedNode.Parent.Text;
  
                  switch (strSwitch)
                  {
                      case "FileHeader":
                          //string strOld = treeViewACH.SelectedNode.Text.ToString();
                          contextMenuStrip1.Show(treeViewACH, e.Location);
                          break;
                  }
              }
              else
              {
                  // MessageBox.Show("Left clicked");
              }
          }
      }
  </code></pre>
  
  <p>// To rename</p>
  
  <pre><code>    private void treeViewACH_AfterLabelEdit(object sender, NodeLabelEditEventArgs e)
      {
          if (e.Label.IndexOfAny(new char[]{'\\', 
          '/', ':', '*', '?', '"', '&lt;', '&gt;', '|'}) != -1)
          {
              MessageBox.Show("Invalid tree node label.\n" +
                "The tree node label must not contain " +
                    "following characters:\n \\ / : * ? \" &lt; &gt; |",
                "Label Edit Error", MessageBoxButtons.OK,
                MessageBoxIcon.Error);
              e.CancelEdit = true;
              return;
  
  
          }
      }
  </code></pre>