I have a window form application, inside this application, there have several textbox and want to replace the breakline and send out as email in one click. Since i have multiple textbox, instead of writing like this:
string text = textBox1.Text;
text = text.Replace("\n", "<br/>");
string text2 = textBox2.Text;
text2 = text2.Replace("\n", "<br/>");
...
string textBody ="<tr bgcolor = '#C39BD3'><td>Name</td><td>" + text + "</td></tr>" +"<tr bgcolor = '#C39BD3'><td>Age</td><td>" + text2 + "</td></tr>" + ...
is there any ways to replace the line in these textbox in one time?
I try to put in a loop:
for (int i = 1; i < 20; i++)
{TextBox txtbox = (TextBox)this.Controls.Find("textBox" + i, true)[0]; }
I stuck at here. Any suggestion?