By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,471 Members | 711 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,471 IT Pros & Developers. It's quick & easy.

Line Breaking

P: 5

I want to move to the next line in the text box after reaching text length 70 characters can any one help me
Feb 24 '09 #1
Share this Question
Share on Google+
4 Replies

Expert 100+
P: 692

Try the following code in order to insert a new line in a text of text box:

Expand|Select|Wrap|Line Numbers
  1.             if (TextBox1.Text.Length == 70)
  2.             {
  3.                //check if no of characters in a textbox is equal to 70
  4.                 TextBox1.Text += "\n";
  5.             }
Feb 24 '09 #2

Expert 5K+
P: 7,872
Well it would be "\r\n" for windows systems. ("\n" is used on linux/unix and "\r" is used on MAC I believe)
At any rate you could just use Environment.NewLine
Feb 24 '09 #3

P: 40
Plater: \r was used on older Macs. OS X is Unix, so it uses \n also.
Feb 25 '09 #4

Expert 5K+
P: 7,872
Learn something new everyday.
Feb 25 '09 #5

Post your reply

Sign in to post your reply or Sign up for a free account.