954,549 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Line feeds in a Textbox

I am trying to add new lines to a TextBox control. I have MultiLine set to true and AcceptsReturn set to true. If I use the AppendText() method, I just get more text immediately behind what is already there. If I insert or add a newline escape \n it just prints a box in the text at that point. I can't believe this control is that stupid. Maybe it's me. Is there any way to get a newline into a TextBox???

fishsqzr
Junior Poster in Training
57 posts since Aug 2007
Reputation Points: 10
Solved Threads: 1
 

Use either Environment.NewLine or "\r\n". Environment.NewLine is more portable, but that's not a big problem with .net programs. ;)

Hamrick
Posting Whiz
325 posts since Jun 2007
Reputation Points: 180
Solved Threads: 34
 

use Textbox.Text+= yourString;

Ramy Mahrous
Postaholic
2,196 posts since Aug 2006
Reputation Points: 480
Solved Threads: 276
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You