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)
{
……
}
查看全文
相关阅读:
陆金所的8.61%是怎么算出来的
自已开发完美的触摸屏网页版仿app弹窗型滚动列表选择器/日期选择器
JavaScript移除绑定在元素上的匿名事件处理函数
JavaScript : 零基础打造自己的jquery类库
自定义右键菜单
移动端拖拽(模块化开发,触摸事件,webpack)
读书笔记--对象、实例、原型、继承
JavaScript的Object的一些静态方法(*************************************************************)
CSS3模拟IOS滑动开关
lnrfvnhjttpvvlj
原文地址:https://www.cnblogs.com/flashicp/p/726904.html
最新文章
编译打包是一回事,部署是另一回事
3第一周课后练习·阅读计划(3)-使用函数来访问私有数据成员
Multiscale Combinatorial Grouping 学习和理解源代码(一)
苹果试图做?XCode6 放弃prefix.pch档
面试经典(7)--最大持续子阵
hdu1753()模拟大型实景数字相加
Ansible@一个有效的配置管理工具--Ansible configure management--翻译(十二)
ACdreamOJ 1154 Lowbit Sum (数字dp)
Kolor Neutralhazer v1.0.2 (照片雾气模糊去除过滤器)+破解RI
Android项目实战-云词典
热门文章
左右HttpClient上传的方法来解决中国的乱码
炒黄金需要克服的不良心理
M0、M1、M2、M3都是用来反映货币供应量的重要指标
宽松货币政策
delphi 转换sql server 中的 bit类型
网贷论坛
【网贷投资手册】P2P行业揭秘
U8800安装软件显示无效的URI问题
华为u8800+ root 还是不能删除自带软件
好的投资理财论坛 个人以为, 有好的请告知啊
Copyright © 2011-2022 走看看