Click here to Skip to main content
15,922,650 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In my asp.net project, I use either one of the expressions below
CSS
textbox1.Text = "First " + System.Environment.NewLine + " Second";
textbox1.Text = "First \r\n Second";

the text in the textbox1 is always on the same line. Why? Thanks.
Posted

Set the TextMode property to Multiline as follows:

C#
textbox1.TextMode = TextBoxMode.MultiLine
 
Share this answer
 
Comments
[no name] 2-Apr-14 9:11am    
Perfect. I set the control's property. Thanks.
Did you set the TextBox.TextMode property to Mutiline? See TextBox.TextMode Property[^].
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900