943,987 Members | Top Members by Rank

Ad:
  • C# Discussion Thread
  • Unsolved
  • Views: 3505
  • C# RSS
Sep 7th, 2007
0

Line feeds in a Textbox

Expand Post »
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???
Similar Threads
Reputation Points: 10
Solved Threads: 1
Junior Poster in Training
fishsqzr is offline Offline
57 posts
since Aug 2007
Sep 7th, 2007
0

Re: Line feeds in a Textbox

Use either Environment.NewLine or "\r\n". Environment.NewLine is more portable, but that's not a big problem with .net programs.
Reputation Points: 180
Solved Threads: 34
Posting Whiz
Hamrick is offline Offline
322 posts
since Jun 2007
Sep 11th, 2007
0

Re: Line feeds in a Textbox

use Textbox.Text+= yourString;
Featured Poster
Reputation Points: 480
Solved Threads: 276
Postaholic
Ramy Mahrous is offline Offline
2,189 posts
since Aug 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C# Forum Timeline: RichTextBox question
Next Thread in C# Forum Timeline: Delete Internet Temporary Files





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC