I just want to load a text file *.txt to a textbox in my program any help is welcomed :) thanks
Printable View
I just want to load a text file *.txt to a textbox in my program any help is welcomed :) thanks
'Heres a simple code that will import the 'first line.
Dim Line1 As String
Open "c:\project1.txt" For Input As #1
Input #1, Line1
Text1.Text = Line1
'to get more than one line under Input #1, Line1 put Input #1, Line2 and that will get the second one and Input #1, Line3 under that to get the third line and then just adjust ther text1.text to somthing like text1.text = line1 + line 2 + Line 3 and so on.
Hello!
Try this:
open "file.txt" for input as #1
text1.text=input(lof(1),#1)
close #1
this function loads whole text file to textbox, but beware... text files mustn't be larger than 64 Kb
------------------