Line feeds in a Textbox

Please support our C# advertiser: Intel Parallel Studio Home
Reply

Join Date: Aug 2007
Posts: 57
Reputation: fishsqzr is an unknown quantity at this point 
Solved Threads: 1
fishsqzr fishsqzr is offline Offline
Junior Poster in Training

Line feeds in a Textbox

 
0
  #1
Sep 7th, 2007
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???
Reply With Quote Quick reply to this message  
Join Date: Jun 2007
Posts: 322
Reputation: Hamrick will become famous soon enough Hamrick will become famous soon enough 
Solved Threads: 33
Hamrick's Avatar
Hamrick Hamrick is offline Offline
Posting Whiz

Re: Line feeds in a Textbox

 
0
  #2
Sep 7th, 2007
Use either Environment.NewLine or "\r\n". Environment.NewLine is more portable, but that's not a big problem with .net programs.
The truth does not change according to our ability to stomach it.
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 2,065
Reputation: Ramy Mahrous is just really nice Ramy Mahrous is just really nice Ramy Mahrous is just really nice Ramy Mahrous is just really nice 
Solved Threads: 256
Featured Poster
Ramy Mahrous's Avatar
Ramy Mahrous Ramy Mahrous is offline Offline
Postaholic

Re: Line feeds in a Textbox

 
0
  #3
Sep 11th, 2007
use Textbox.Text+= yourString;
BI Developer | LINKdotNET
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC