Line Breaking

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sriharikabattula
    New Member
    • Feb 2009
    • 5

    Line Breaking

    hi,

    I want to move to the next line in the text box after reaching text length 70 characters can any one help me
  • shweta123
    Recognized Expert Contributor
    • Nov 2006
    • 692

    #2
    Hi,

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

    Code:
                if (TextBox1.Text.Length == 70)
                {
                   //check if no of characters in a textbox is equal to 70
                    TextBox1.Text += "\n";
                }

    Comment

    • Plater
      Recognized Expert Expert
      • Apr 2007
      • 7872

      #3
      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.New Line

      Comment

      • artov
        New Member
        • Jul 2008
        • 40

        #4
        Plater: \r was used on older Macs. OS X is Unix, so it uses \n also.

        Comment

        • Plater
          Recognized Expert Expert
          • Apr 2007
          • 7872

          #5
          Originally posted by artov
          Plater: \r was used on older Macs. OS X is Unix, so it uses \n also.
          Learn something new everyday.

          Comment

          Working...