Private Sub File1_Click()
'点击列表,读取TXT文件内容
'参考MSDN OPEN语句用法
Dim FileLine As String
'On Error Resume Next
Open File1.Path & File1.List(Index) For Input As #1
Do While Not EOF(1)
Line Input #1, FileLine
Text1.Text = Text1.Text & vbCrLf & FileLine
Loop
Close #1
End Sub
Private Sub Form_Load()
'Text1的MultiLine设置为True
'设置FILELISTBOX文件路径,文件类型
File1.Pattern = "*.txt"
File1.Path = "c:\"
Text1.Text = ""
End Sub