display the parsed text in a textbox

Gluttard

Active member
Joined
Jan 9, 2008
Messages
44
Programming Experience
Beginner
Hmm, now in a new application, I need to read text from a file, and then display the parsed text in a textbox.
This works fine, but I don't know how to insert one part of the file, then go to the next line, write another, etc.
 
Post moved... new topic.

Is it the textbox.AppendText method that causes problems?
 
Ah sorry, I should have made a new topic.

Well, if I have a textbox that has a width of 300 and I display text into it.
I display the text from a textfile, and I want each part that is deliminated by a "," on a seperate line. This only works for me if I put spaces in afterwards, but that doesn't work all the time. How can I insert a Carriage Return type thing?
{ENTER} didn't work... I didn't quite expect it to.
 
So you're saying that each "line" is delimited by a comma, but there is no space after the comma, before the next "line", correct?

If so then you can use the String.Replace method. You can replace every comma with a line break, or with a comma and a line break if you want to keep the commas, e.g.
VB.NET:
myTextBox.Text = myString.Replace(",", "," & Environment.NewLine)
 
Back
Top