Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Newlines in my Edit Box

Newlines in my Edit Box

Scheduled Pinned Locked Moved C / C++ / MFC
question
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    bugDanny
    wrote on last edited by
    #1

    I'm trying to make an edit box that will involve more complicated entry than just one line. In fact, sometimes I want to prefill my edit box from a file. I've already set the multiline property, and the 'want return' property, so it appears to be working properly when typing into it, but if I load in information from a file, the newline characters get changed into a funny vertical blackened box. How can I get the edit box to format them properly, turning the newline character into an actual newline? Danny

    D C 2 Replies Last reply
    0
    • B bugDanny

      I'm trying to make an edit box that will involve more complicated entry than just one line. In fact, sometimes I want to prefill my edit box from a file. I've already set the multiline property, and the 'want return' property, so it appears to be working properly when typing into it, but if I load in information from a file, the newline characters get changed into a funny vertical blackened box. How can I get the edit box to format them properly, turning the newline character into an actual newline? Danny

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      bugDanny wrote: How can I get the edit box to format them properly, turning the newline character into an actual newline? Use \r\n instead.


      "One must learn from the bite of the fire to leave it alone." - Native American Proverb

      1 Reply Last reply
      0
      • B bugDanny

        I'm trying to make an edit box that will involve more complicated entry than just one line. In fact, sometimes I want to prefill my edit box from a file. I've already set the multiline property, and the 'want return' property, so it appears to be working properly when typing into it, but if I load in information from a file, the newline characters get changed into a funny vertical blackened box. How can I get the edit box to format them properly, turning the newline character into an actual newline? Danny

        C Offline
        C Offline
        Chris Losinger
        wrote on last edited by
        #3

        replace all \n in the text with \r\n Cleek | Image Toolkits | Thumbnail maker

        B 1 Reply Last reply
        0
        • C Chris Losinger

          replace all \n in the text with \r\n Cleek | Image Toolkits | Thumbnail maker

          B Offline
          B Offline
          bugDanny
          wrote on last edited by
          #4

          Thank you both. By the way, what does the \r mean? Danny

          C 1 Reply Last reply
          0
          • B bugDanny

            Thank you both. By the way, what does the \r mean? Danny

            C Offline
            C Offline
            Chris Losinger
            wrote on last edited by
            #5

            \r = carriage return edit controls apparently refuse to honor new lines (\n) and require CR/LF pairs. Cleek | Image Toolkits | Thumbnail maker

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups