示例#1
0
 private void contextmenufolder_Click(object sender, EventArgs e)
 {//右键添加文件夹
     try
     {
         NewFolder folderDlg = new NewFolder();
         folderDlg.lbParentPath.Text = CurPath[CurPath.Count - 1];
         if (folderDlg.ShowDialog() == DialogResult.OK)
         {
             string CurFullPath = CurPath[CurPath.Count - 1];
             FillFilesView(CurFullPath);
         }
         folderDlg.Dispose();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
示例#2
0
 private void NewFolder_Click(object sender, EventArgs e)
 {//新建文件夹
     try
     {
         NewFolder folderDlg = new NewFolder();                    //实例化一个NewFolder对象
         folderDlg.lbParentPath.Text = CurPath[CurPath.Count - 1]; //NewFolder上显示当前路径
         if (folderDlg.ShowDialog() == DialogResult.OK)            //弹出对话框
         {
             string CurFullPath = CurPath[CurPath.Count - 1];      //获取当前路径
             FillFilesView(CurFullPath);                           //刷新ListView
         }
         folderDlg.Dispose();                                      //释放对话框
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }