hey...i got a problem..
Now i do the read text file line by line. I am using the ReadLine Function to do that. But It cannot show all the output. It always show the last one content in text file. It cannot show the previous content in text file to the text box. Who can help me to solve it...?
Thank you so much...

Recommended Answers

All 5 Replies

Did you set the scrollbar property of you textbox?

yes. i think is coding problem..

If you are using VS you can set that property in the properties window.

StreamReader.ReadLine() reads one line at a time. If you want multiple lines you will have to loop through the data.
Or, depending on the program, you may be able to do the event multiple times reading one line of text each time.

Make sure the textbox is set to multiline.

To append your text to what is in the box, use the += operator.
In your loop: (obviously read the line of text into a temporary if you're using .ReadLine() to drive the loop)

myTextBox.Text +=(myStreamReader.ReadLine()+"\r\n");

I didn't test that out, but that's the gist of it

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.