CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Guest

    Edit Box and adding text

    I am trying to add text to a multiline edit box by using the SetWindowText method in MFC. The text has embedded '\n' so that the text will show up as multiline. Instead of going to a new line, the '\n' shows up as a solid pipe '|'. Is there a way to add multiline text to an edit box with a single method call? If not, what is the best way to do it? The text doesn't have to be editable, only scrollable.


  2. #2
    Join Date
    May 1999
    Location
    Farnborough, Hants, England
    Posts
    710

    Re: Edit Box and adding text

    First, to clear up any possible slip-up, make sure the edit box has the multiline property set in the dialogue resource. Yes, I *know* you're not that stupid, but I have to cover all possibilities.

    If that is OK, try using "\r\n" instead of just '\n'. Multiline text tends to recognise that character pair rather than just the single line feed - CDC:rawText() expects this, for example.

    Does this help?



    --
    Jason Teagle
    [email protected]

  3. #3
    Guest

    Re: Edit Box and adding text

    Thanx, helped me too...


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