Click to See Complete Forum and Search --> : textboxes
vb5prog
Dec 16th, 1999, 11:10 AM
I just want to load a text file *.txt to a textbox in my program any help is welcomed :) thanks
Insane Killa
Dec 16th, 1999, 11:18 AM
'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.
Zvonko
Dec 16th, 1999, 10:58 PM
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
------------------
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.