CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 1999
    Location
    CA,USA
    Posts
    22

    New Line in CRichEditCtrl ??

    I have a class which was CRichEditView, now transferred to CRichEditCtrl.
    After the transfer, the newlines, "\r\n" are not being honored. Everthing appears on one line..!!
    The code snippet I am using to add each line of text to the control looks like;

    SetSel(nChars, nChars); // point end of document

    ReplaceSel((LPCSTR)szBuffer); // display text



    where szBuffer is a string terminated with "\r\n"
    Why is it not breaking the line as it did whan it was a View??

    Thanks,

    Bryan.



  2. #2
    Join Date
    Apr 2000
    Location
    San Francisco, California, USA
    Posts
    4,467

    Re: New Line in CRichEditCtrl ??

    Didn't you forget to set ES_MULTILINE style?

    Russian Software Development Network -- http://www.rsdn.ru

  3. #3
    Join Date
    Oct 1999
    Location
    CA,USA
    Posts
    22

    Re: New Line in CRichEditCtrl ??

    Duh! That fixed it, I didn't need it when it was a View so when I made it a Ctrl, additional flags got overlooked.

    Many Thanks,

    Bryan.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured