I am trying to make a word wrap type function for a multi line text box
field that will be saved to a text file. The word wrap property looks good
in the app but when saved to a text file the line goes on and on where there
is not a new line character in the text box.
Here's kinda what I'm looking at:
//start snippet
public void WrapIt()
{
int lines = txtMessage.Lines.Length;
string[] tempArray = new string[txtMessage.Lines.Length];
for (int i =0; i < lines; i++)
{
if (txtMessage.Lines[i].Length < 69)
{
tempArray.SetValue(txtMessage.Lines[i] + "\n", i);
}
else
{
//PART WHERE I'M STUCK
}
}
txtMessage.Clear();
for (int i=0;i<tempArray.Length; i++)
{
txtMessage.AppendText(tempArray[i]);
}
}
//end snippet
Many thanks in advance,
Joe