private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
         {
               
             TreeNode tn = new TreeNode();
             treeView1.SelectedNode = treeView1.GetNodeAt(e.X, e.Y);
          textBox_path.Text = GetPathname(treeView1.SelectedNode.FullPath);//整理路径的自编方法。
           
            
            if (e.Button == MouseButtons.Right)
             {
                 this.treeView1.SelectedNode = e.Node;
                 aftermenu.Show(MousePosition);//下拉菜单
                
               
                
             } 
private void 新建目录ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (textBox_path.Text == "计算机")
            {
                MessageBox.Show("不能创建目录", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            else
            {
                
                TreeNode tnde = new TreeNode();
                  tnde.Text = "新建文件夹";
                    treeView1.SelectedNode.Nodes.Add(tnde);
                    treeView1.SelectedNode = tnde;
                    treeView1.LabelEdit = true;
                    tnde.BeginEdit();//在treeview中编辑好节点名字之后 单击回车或者单击鼠标左键推出编辑
然后在textbox_path空间中显示出路径?但是,编辑结束后没有在原路径后出现新的节点名称,而是必须单击一下才会出现。有没有解决办法?
 
                   
                    
                   
                    
                    
                //}
                
            }
           
        }