在文本框中显示txt文档,当行数超过几千时特别慢,程序卡死,帮忙优化一下,该如何解决
在文本框中显示txt文档,当行数超过几千时特别慢,程序卡死,帮忙优化一下
我的代码:
outputfilename = App.Path + "\ " + "output.txt "
outlnghandle = FreeFile()
Open outputfilename For Input As outlnghandle
Do While Not EOF(outlnghandle)
Line Input #outlnghandle, strline
strall = strall & strline & vbCrLf '是不是这句有问题
Loop
Close outlnghandle
Text1.Text = strall
------解决方案--------------------
使用richtext会快很多
FileName = App.Path + "\ " + "output.txt "
RichTextBox1.LoadFile FileName
------解决方案--------------------
和楼上想法一样
我的代码:
outputfilename = App.Path + "\ " + "output.txt "
outlnghandle = FreeFile()
Open outputfilename For Input As outlnghandle
Do While Not EOF(outlnghandle)
Line Input #outlnghandle, strline
strall = strall & strline & vbCrLf '是不是这句有问题
Loop
Close outlnghandle
Text1.Text = strall
------解决方案--------------------
使用richtext会快很多
FileName = App.Path + "\ " + "output.txt "
RichTextBox1.LoadFile FileName
------解决方案--------------------
和楼上想法一样