Hi,
If I have a textfile with, for an example, 3 different lines, how can I read that lines and put them in 3 different textboxes per line.
thnx:cool:
Printable View
Hi,
If I have a textfile with, for an example, 3 different lines, how can I read that lines and put them in 3 different textboxes per line.
thnx:cool:
do you want to put each line into a textbox by itself, or do you want to split each line into 3 different textboxes? Post an example of what you have, and what you want.
I want to put each line into a textbox by itself.
Thanks for replay!
Assumes that there are only 3 lines in the file.Code:Dim TestLine
Dim Counter As Integer
Counter = 1
Open "Testfile" For Input As #1
Do While Not EOF(1)
Line Input #1, TestLine
select case Counter
case 1
Textbox1.Text = TestLine
case 2
Textbox2.Text = TestLine
case 3
Textbox3.Text = TestLine
End Select
Counter = Counter + 1
Loop
Close #1
Substitute the name of your textboxes in the select statement.
It works!:bigyello:
Thank you very much!:thumb:
Greetings Roger:wave:
Hi dglienna,
Can you help me to figure out the following issue:
Does VB has any method to get the total line count before loop to read each line? I want to use progressBar control to give the processing percentage of the file. (the lines in file is read one line by one line). To use the ProgressBar control, have to know the total line count and assign the value to the Max property of ProgressBar. Have any advice?
Thanks,
Robert Song
not unless you save the total first when you are writing the file. then you can read the total, and then loop from there. I do that for a bunch of items that can be changed, yet the program can still deal with them all.
Or, you could compute 25% and display that, then 50% from within the loop that is reading the info.