I want to open a text file one line at a time and place each line into its own textbox
Any help would be great
Printable View
I want to open a text file one line at a time and place each line into its own textbox
Any help would be great
something like;
Dim line As String
Open FileName For OutPut As #1
Do Until EOF #1
LineInput #1, Line
Text1.Text = Text1.Text + Line
Line = ""
Loop
How do i get the second line into the second textbox
Well if its only a 2 line Text File
Dim line As String
Dim Line2 As String
'Open the File
Open FileName For OutPut As #1
'Get the First Line
LineInput #1, Line
Text1.Text = Text1.Text + Line
Line = ""
'Get the Second Line
LineInput #1, Line2
Text2.Text = Text2.Text + " " + Line2
Line2 = ""
Close #1
thank you, works great
No prop
if you want to make your program so it does this with bigger files with more lines in and you dont know how many lines and how many test boxes you are going to need you could use a control array of textboxes to acheive this - just adding text boxes when you need them :)