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. C / C++ / MFC
  3. CEdit Newlines?

CEdit Newlines?

Scheduled Pinned Locked Moved C / C++ / MFC
3 Posts 2 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.
  • G Offline
    G Offline
    Gregg Carlstrom
    wrote on last edited by
    #1

    I'm hoping that I'm just overlooking an easy solution to this problem. I'm formatting some text in a CString, and need to insert newlines into that text -- I've tried using both '\n' and '\r', and their ASCII numeric equivalents. This text is then displayed in a CEdit control -- problem is, the newlines show up as those bold black boxes (the ones that usually mean "invalid character"), rather than as newlines. The CEdit/CStatic documentation doesn't seem to cover this -- is there an escape sequence I'm missing? The only way I've gotten it working thus far is to make the CString::Format() call span multiple physical lines in my code, which is a pretty hacked solution. I'm sure this one qualifies as a stupid question, but if anyone has a solution, I'd really appreciate it. :) Thanks.

    M 1 Reply Last reply
    0
    • G Gregg Carlstrom

      I'm hoping that I'm just overlooking an easy solution to this problem. I'm formatting some text in a CString, and need to insert newlines into that text -- I've tried using both '\n' and '\r', and their ASCII numeric equivalents. This text is then displayed in a CEdit control -- problem is, the newlines show up as those bold black boxes (the ones that usually mean "invalid character"), rather than as newlines. The CEdit/CStatic documentation doesn't seem to cover this -- is there an escape sequence I'm missing? The only way I've gotten it working thus far is to make the CString::Format() call span multiple physical lines in my code, which is a pretty hacked solution. I'm sure this one qualifies as a stupid question, but if anyone has a solution, I'd really appreciate it. :) Thanks.

      M Offline
      M Offline
      Michael Dunn
      wrote on last edited by
      #2

      Use "\r\n" to get a new line. --Mike-- http://home.inreach.com/mdunn/ #include "buffy_sig"

      G 1 Reply Last reply
      0
      • M Michael Dunn

        Use "\r\n" to get a new line. --Mike-- http://home.inreach.com/mdunn/ #include "buffy_sig"

        G Offline
        G Offline
        Gregg Carlstrom
        wrote on last edited by
        #3

        Yep, that was the easy answer I was missing. :) Thanks.

        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