Dim b
Private Sub Dir1_Change()
File1.Path = Dir1.Path
End Sub
Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive
End Sub
Private Sub File1_Click()
Text1.Text = Dir1.Path & "\" & File1.FileName
'-------------在Text2文本框显示该文本文件内容-------------------------
Open Text1.Text For Input As #1
b = ""
Do Until EOF(1)
Line Input #1, nextline
b = b & nextline & Chr(13) & Chr(10)
Loop
Close #1
Text2.Text = b
End Sub
Private Sub File1_DblClick()
Shell "C:\winnt\system32\notepad.exe " & File1.FileName, vbMaximizedFocus
End Sub
Private Sub Form_Load()
Text1.Text = ""
Text2.Text = ""
Drive1.Drive = "c:\"
Rem
File1.ReadOnly = True
File1.Archive = False
File1.System = False
File1.Normal = True
File1.Hidden = False
Rem
File1.Pattern = "*.txt"
End Sub
在Text2文本框显示该文本文件内容,这个功能我写的那个好像有点问题,期待高人指点