利用下面的程序从一个文件中向Text框中输入文字,怎么也换不了行,向各位大虾请教!
 Open "d:\VB.txt" For Input As #1
 While Not EOF(1)
  Line Input #1, line
  Text1 = Text1 + line + Chr(13) + Chr(10)
  Wend
 Close #1

解决方案 »

  1.   

    Open "d:\VB.txt" For Input As #1
    '***********
    Text1.MultiLine =true
    '************ 
    While Not EOF(1)
      Line Input #1, line
      Text1 = Text1 + line + Chr(13) + Chr(10)
      Wend
     Close #1
      

  2.   

    要将Text1的MultiLine设为True,最好再将ScrollBars设为2
      

  3.   

    给你一个更快的方法:
    dim fNum as integer
    dim strTemp as string
    fNum=freefile
    open "d:\VB.txt" for binary as #fNum
    strTemp=String(" ",lof(fNum)) '得到和文件长度一样长的字符串
    Get #fNum,strTemp '一次读取整个文件
    Text1.MultiLine =true
    Text1=strTemp
    close #fNum
    主要是一行行读取的速度太慢了!
      

  4.   

    我在网吧里,不知道Get语句有没有写错,如果有错误的话还请体谅!
      

  5.   

    将text1的属性MultiLine 设为 True(记的是只读的,需要在设计时用)Open "d:\VB.txt" For Input As #1
     While Not EOF(1)
      Line Input #1, line
      Text1 = Text1 + line + vbcrlf '比chr(13)+chr(10)方便多了
      Wend
     Close #1
      

  6.   

    要将Text1的MultiLine设为True,最好再将ScrollBars设为2
      

  7.   

    将text1的属性MultiLine 设为 True(记的是只读的,需要在设计时用)Open "d:\VB.txt" For Input As #1
     While Not EOF(1)
      Line Input #1, line
      Text1 = "我是一个中国人" + line +“操他妈的日本人”+ vbcrlf '比chr(13)+chr(10)方便多了
      Wend
     Close #1