textbox newline

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • john bailo

    textbox newline

    How do create a new line in a text box.

    If I put \n in my string, and set .Text to the
    value of the string, a carriage return character is displayed literally,
    but it doesn't actually start on a new line in the textbox.



  • Alan Pretre

    #2
    Re: textbox newline

    "john bailo" <jbailo@vestcom .com> wrote in message
    news:148d6ea887 42e2b6472154919 ec3aad8@news.te ranews.com...[color=blue]
    > How do create a new line in a text box.
    > If I put \n in my string, and set .Text to the
    > value of the string, a carriage return character is displayed literally,
    > but it doesn't actually start on a new line in the textbox.[/color]

    Use \r\n.

    -- Alan


    Comment

    • Bob Powell [MVP]

      #3
      Re: textbox newline

      If you do it programatically "Something\r\nW icked" it will show up as a
      newline but not if you go through the designer. Also, ensure that you don't
      have the @ (literal string) in front of it.

      --
      Bob Powell [MVP]
      C#, System.Drawing

      September's edition of Well Formed is now available.


      Answer those GDI+ questions with the GDI+ FAQ




      "john bailo" <jbailo@vestcom .com> wrote in message
      news:148d6ea887 42e2b6472154919 ec3aad8@news.te ranews.com...[color=blue]
      > How do create a new line in a text box.
      >
      > If I put \n in my string, and set .Text to the
      > value of the string, a carriage return character is displayed literally,
      > but it doesn't actually start on a new line in the textbox.
      >
      >
      >[/color]


      Comment

      • Empire City

        #4
        Re: textbox newline

        Where can you look up all those \r\n thingy me gigs in the in the
        documentation?



        Comment

        • john bailo

          #5
          Re: textbox newline

          "Bob Powell [MVP]" <bob@_spamkille r_bobpowell.net > wrote in message
          news:%23QZeM4pj DHA.2000@TK2MSF TNGP12.phx.gbl. ..[color=blue]
          > If you do it programatically "Something\r\nW icked" it will show up as a
          > newline but not if you go through the designer. Also, ensure that you[/color]
          don't[color=blue]
          > have the @ (literal string) in front of it.
          >
          > Bob Powell [MVP]
          > C#, System.Drawing[/color]

          Thanks -- I left off the \r and just put in the \n

          Now it works !!!

          Thanks Bob.


          Comment

          • Bob Powell [MVP]

            #6
            Re: textbox newline

            >all those \r\n thingy me gigs

            Not many of them...

            \\ literal backslash
            \n literal newline
            \r literal carriage return
            \t literal horizontal tab
            \v literal vertical tab
            \" literal double-quote

            \v is recognized but you can't use it in a text box.

            --
            Bob Powell [MVP]
            C#, System.Drawing

            September's edition of Well Formed is now available.


            Answer those GDI+ questions with the GDI+ FAQ




            "Empire City" <a@b.com> wrote in message
            news:45khb.2771 2$pv6.26733@twi ster.nyc.rr.com ...[color=blue]
            > Where can you look up all those \r\n thingy me gigs in the in the
            > documentation?
            >
            >
            >[/color]


            Comment

            • Bob Powell [MVP]

              #7
              Re: textbox newline

              Theres more.. here's the definitive list.

              \' Single quote
              \" Double quote
              \\ Backslash
              \0 Null
              \a Alert / Bell
              \b Backspace
              \f Form feed
              \n New line
              \r Carriage return
              \t Horizontal tab
              \v Vertical tab


              --
              Bob Powell [MVP]
              C#, System.Drawing

              September's edition of Well Formed is now available.


              Answer those GDI+ questions with the GDI+ FAQ




              "Empire City" <a@b.com> wrote in message
              news:45khb.2771 2$pv6.26733@twi ster.nyc.rr.com ...[color=blue]
              > Where can you look up all those \r\n thingy me gigs in the in the
              > documentation?
              >
              >
              >[/color]


              Comment

              Working...