Monday, March 26, 2012

Text in Multiline

i have 3 to 4 text box

TextBox1.Text=abc;

TextBox2.Text=def;

TextBox3.Text=ghi;

TextBox4.Text=jkl;

SubmitButton

i also have,

TextBox5

what i want when someone clicks on submit button, the text in all the textboxes should be lined up in text box 5 one below the other like this

abc

def

ghi

jkl

but all i get is

abcdefghijkl

what is going wrong

my code is

TextBox5.Text=TextBox1.Text+TextBox2.Text+TextBox3.Text+TextBox4.Text;

Use System.Environment.NewLine in between each TextBox

string result = TextBox1.Text + System.Environment.NewLine + TextBox2.Text + .....

Thanks


it doesnt seem to work still i get the text in one single line

Did you set the last TextBox text mode to Multiline? I have tested and its working fine.

Thanks


Thanks for you suggestion once aagain..it works fine now

0 comments:

Post a Comment