I created a for using several textboxes that have multiple lines enabled and i noticed that when i enter data, it prints it to the text file in one really long ling. How do i get it to wrap the contents of the textbox?
I have tried this with not luck. I found the post on this site while trying to search for the answer, but it didn't work for me.
My code starts
text7 = textBox7.Text;
if(text7.Equals(""))
{
Messagebox.Show("You must fill in this information");
return;
}
StringReader sr = new StringReader(text7); string LineData = sr.ReadLine(); while (LineData != null){
sw.WriteLine(text7);
LineData = sr.ReadLine();
}
Blocked AccountPosted Jan 18, 2008, 12:36 AM
I think use this line sw.WriteLine(LineData ) in the place of sw.WriteLine(text7)
It's the modified code.
text7 = textBox7.Text;
if(text7.Equals(""))
{
Messagebox.Show("You must fill in this information");
return;
}
StringReader sr = new StringReader(text7);
string LineData = sr.ReadLine();
while (LineData != null)
{
sw.WriteLine(LineData );
LineData = sr.ReadLine();
}
Happy Coding!!