📄 wen3.frm
字号:
VERSION 5.00
Begin VB.Form Form3
Caption = "重命名"
ClientHeight = 1140
ClientLeft = 48
ClientTop = 276
ClientWidth = 3744
LinkTopic = "Form4"
LockControls = -1 'True
MaxButton = 0 'False
ScaleHeight = 1140
ScaleWidth = 3744
StartUpPosition = 3 'Windows Default
Begin VB.CommandButton Command2
Caption = "取消"
BeginProperty Font
Name = "宋体"
Size = 10.8
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 372
Left = 2520
TabIndex = 3
Top = 720
Width = 972
End
Begin VB.CommandButton Command1
Caption = "确定"
BeginProperty Font
Name = "宋体"
Size = 10.8
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 372
Left = 1320
TabIndex = 2
Top = 720
Width = 1092
End
Begin VB.TextBox Text1
Height = 264
Left = 120
TabIndex = 1
Top = 360
Width = 3372
End
Begin VB.Label Label1
Caption = "输入新名字"
BeginProperty Font
Name = "宋体"
Size = 10.8
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 252
Left = 120
TabIndex = 0
Top = 120
Width = 2292
End
End
Attribute VB_Name = "Form3"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim lenPath As Integer
Dim tempName$, msg$
On Error GoTo errBad
If curFile <> "" Then '说明点击的是文件列表
If Right$(curName, 1) <> "\" Then
tempName$ = curName & "\"
End If
Name curFile As tempName$ & Text1.Text
Form1.File1.Refresh
Else '双击的是目录列表
lenPath = Len(curDirec)
tempName$ = curDirec
'查找上一级目录,以便目录列表更新
Do While lenPath <> 1
If Right$(tempName$, 1) = "\" Then
tempName$ = Left$(tempName$, lenPath)
Exit Do
End If
tempName$ = Left$(tempName$, lenPath - 1)
lenPath = Len(tempName$)
Loop
If lenPath = 1 Then Exit Sub
Name curDirec As tempName$ & Text1.Text
tempName$ = Left$(tempName$, lenPath - 1)
'测试是否到了根目录
If Right$(tempName$, 1) = ":" Then
tempName$ = tempName$ & "\"
End If
Form1.Dir1.Path = tempName$
ChDir Form1.Dir1.Path
Form1.Dir1.Refresh
End If
Unload Form3
Exit Sub
errBad:
msg$ = "发现未知错误,错误号=" + Str$(err)
MsgBox msg$, vbOKOnly
End Sub
Private Sub Command2_Click()
Unload Form3
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -