CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2001
    Location
    Singapore
    Posts
    57

    Insert texts into a multi-row CEdit

    Anyone has a snippet on inserting lines of texts into a multi-row CEdit?
    The CEdit only provides API for extracting, but seems to forget about inserting.


  2. #2
    Join Date
    Apr 2000
    Posts
    257

    Re: Insert texts into a multi-row CEdit

    use SetSel() followed by ReplaceSel()

    /* "Give me a decent hash-function to stand on, and I will move the earth." -Archimedes */


    [email protected]

  3. #3
    Join Date
    Aug 2000
    Location
    West Virginia
    Posts
    7,725

    Re: Insert texts into a multi-row CEdit

    A couple of methods :

    CString str;
    m_edit_control.GetWindowText(str);
    str += "new line \r\n";
    m_edit_control.SetWindowText(str);




    Another method :

    m_edit_controSetSel(m_edit_control.GetWindowTextLength(),-1);
    m_edit_control.ReplaceSel("new line \r\n");






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