CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2004
    Posts
    40

    How to insert multiline text in CEdit?

    Hi all,

    I have multiline text :

    "Text ........ on line 1
    Text ........ on line 2
    Text ........ on line 2"

    How I put it into an editbox?
    or how to control the way to return begining of next line in editbox?

    In VB, I can use funtion of chr(13) to control it in folow:
    String s = "Text ........ on line 1" & chr(13)
    s = s & "Text ........ on line 2" & chr(13)
    s = s & "Text ........ on line 3"
    edtbox.text = s


    Is there something like that?

  2. #2
    Join Date
    Mar 2001
    Posts
    2,529

    Re: How to insert multiline text in CEdit?

    <CR><LF> at the end of each line....[0x13][0x10].

    make sure the edit box properties tab reads multiline.

    hth,

    ahoodin

    if it helped pls rate me high.

  3. #3
    Join Date
    Feb 2002
    Posts
    3,788

    Re: How to insert multiline text in CEdit?

    Quote Originally Posted by somonmen
    Hi all,

    I have multiline text :

    "Text ........ on line 1
    Text ........ on line 2
    Text ........ on line 3"

    How I put it into an editbox?

    CString str = "Text ........ on line 1\r\nText ........ on line 2\r\nText ........ on line 1\r\n";

    m_edit.SetWindowText(str);

  4. #4
    Join Date
    Aug 2004
    Posts
    40

    Re: How to insert multiline text in CEdit?

    Thank all of you!

  5. #5
    Join Date
    Oct 2002
    Location
    Timisoara, Romania
    Posts
    14,360

    Re: How to insert multiline text in CEdit?

    Just want to say to make sure that you use for new line both "\r\n" because only with "\n" won't work.
    Marius Bancila
    Home Page
    My CodeGuru articles

    I do not offer technical support via PM or e-mail. Please use vbBulletin codes.

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