急!如何VB文件列表框双击文件名在文本框中显示文件内容?
1个回答
展开全部
看了你的问题了。。。楼主给我分啊。。。我已经帮你答了啊!!!!
修改file_dblclick如下
Private
Sub
file_dblclick()
Dim
s$
If
Right(File1.Path,
1)
=
"\"
Then
fName
=
File1.Path
+
File1.FileName
Else
fName
=
File1.Path
+
"\"
+
File1.FileName
End
If
Text1.Text
=
fName
Text1.MultiLine
=
True
Open
fName
For
input
As
#1
Do
until
EOF(1)
Line
Input
#1,
s
Text1.Text
=
Text1.Text
&
chr(13)
&
chr(10)
&
s
Loop
Close
#1
End
Sub
修改file_dblclick如下
Private
Sub
file_dblclick()
Dim
s$
If
Right(File1.Path,
1)
=
"\"
Then
fName
=
File1.Path
+
File1.FileName
Else
fName
=
File1.Path
+
"\"
+
File1.FileName
End
If
Text1.Text
=
fName
Text1.MultiLine
=
True
Open
fName
For
input
As
#1
Do
until
EOF(1)
Line
Input
#1,
s
Text1.Text
=
Text1.Text
&
chr(13)
&
chr(10)
&
s
Loop
Close
#1
End
Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询