谁来解释一下这段代码

来源:百度知道 编辑:UC知道 时间:2024/06/07 21:51:31
Private Sub Dir1_Change()
File1.Path = Dir1.Path
File1.FileName = Text1.Text
Label2.Caption = "文件的路径为:" & File1.Path

End Sub

Private Sub Drive1_Change()
Dir1.Path = Drive1.Path
End Sub

Private Sub File1_PatternChange()
Text1.Text = File1.Pattern
Label2.Caption = "文件的路径为" & File1.Path

End Sub

Private Sub text1_keydown(keycode As Integer, shift As Integer)
If keycode = 13 Then
File1.FileName = Text1.Text
Label2.Caption = "文件的路径为" & File1.Path
End If

End Sub

Private Sub Dir1_Change() '这是“文件夹”变化了,也就是选择新的文件夹
File1.Path = Dir1.Path
File1.FileName = Text1.Text
Label2.Caption = "文件的路径为:" & File1.Path '将盘符和提示语句写到标签
End Sub

Private Sub Drive1_Change() '“磁盘”变化了,也就是点击了逻辑盘符
Dir1.Path = Drive1.Path '文件夹置为新选磁盘
End Sub

Private Sub File1_PatternChange() '文件模型变化了
Text1.Text = File1.Pattern '把模型写入text1
Label2.Caption = "文件的路径为" & File1.Path '把路径写入标签
End Sub

Private Sub text1_keydown(keycode As Integer, shift As Integer) 在text1中输入了
If keycode = 13 Then 如果是回车
File1.FileName = Text1.Text 'text1种就是文件名
Label2.Caption = "文件的路径为" & File1.Path
End If
End Sub

Private Sub Dir1_Change() '当盘符变化了,查找TEXT1里面指定的文件名,
File1.Path = Dir1.Path
File1.FileName = Text1.Text
Label2.Caption = "文件的路径为:" & File1.Path '在Label2输入它的路径

End Sub

Privat