zoukankan
html css js c++ java
两种模式的资源管理器代码之———— 重命名文件夹
1)
/***改名***/
#region
/***改名***/
/**/
///
<summary>
///
重命名文件夹
///
</summary>
public
void
Rename()
{
TreeNode node
=
this
._tree.SelectedNode;
DirectoryInfo dirObj
=
this
.GetDirObj(node);
if
(dirObj.Attributes.ToString().IndexOf(
"
ReadOnly
"
)
!=
-
1
)
return
;
inReNameMode
=
true
;
this
.RenameSelectedNode();
}
#endregion
/***LabelEdit***/
#region
/***LabelEdit***/
private
bool
inReNameMode
=
false
;
private
void
_tree_AfterLabelEdit(
object
sender, NodeLabelEditEventArgs e)
{
TreeNode node
=
this
._tree.SelectedNode;
if
(inReNameMode)
{
if
(e.Label
==
null
)
return
;
string
newPath
=
this
.GetNodePathStr(node.Parent)
+
e.Label;
DirectoryInfo dirObj
=
this
.GetDirObj(node);
try
{
dirObj.MoveTo(newPath);
}
catch
(Exception ex)
{
MessageBox.Show(ex.Message);
}
finally
{
inReNameMode
=
false
;
}
}
}
#endregion
2)
/***重命名***/
#region
/***重命名***/
//
重命名
private
void
menuItem2_Click(
object
sender, System.EventArgs e)
{
oldFolder
=
this
.tv_Path.SelectedNode.Text;
this
.tv_Path.LabelEdit
=
true
;
this
.tv_Path.SelectedNode.BeginEdit();
}
#endregion
private void tv_Path_AfterLabelEdit(object sender, System.Windows.Forms.NodeLabelEditEventArgs e)
{
……
}
查看全文
相关阅读:
移动端必备rem布局
个人工作经历、近些日来一些面试总结
JavaScript面向对象核心知识归纳
微信开发工具下载地址
每天运动步数周月切换显示
爬虫-requests
django请求生命周期,FBV和CBV,ORM拾遗,Git
Django + Uwsgi + Nginx 的生产环境部署
沈阳润才教育CRM
网络编程
原文地址:https://www.cnblogs.com/flashicp/p/726904.html
最新文章
将war包部署到服务器的详细步骤
mySql-通过group by分组
java导出excel报错:getOutputStream() has already been called for this response
对于EL表达式和ONGL表达式区别的相关理解
关于只针对ie7浏览器的css问题
数据库SQL语句练习题
Oracle内置函数的相关知识
课数据库SQL语句练习题
rownum 伪列
rowid
热门文章
dual 伪表
数据库SQL语句练习题0613
数据库SQL语句练习题
GUID (全局唯一标识符)
学生选课数据库SQL语句练习题——教师表
第一节:es6开发环境的搭建
获取验证码倒计时
学习vue必备技能vuex
前端知识规整很不错的一个帖子
今日头条头部导航
Copyright © 2011-2022 走看看