function LoadText(byval FileName as string) as string
dim i as integer , txt as string,cl as string
open filename for input as i
do while not eof(i)
if not txt="" then txt=txt & vbcrlf
line input i,cl
txt=txt & cl
loop
loadtext=txt
end function
假如你想点 Command1时在 Text1 中显示 D:\text.txt 中的文本,请像这样做
private sub Command_Click()
text1=loadtext("D:\text.txt")
end sub
温馨提示:答案为网友推荐,仅供参考