CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    May 1999
    Location
    Mora,Sweden
    Posts
    38

    adding a new line in an editbox

    How do I add a new line in an editbox?

    I have tried this:
    int tLen = GetEditCtrl().GetWindowTextLength();
    GetEditCtrl().SetSel(tLen,tLen);
    GetEditCtrl().ReplaceSel("\n");
    tLen = GetEditCtrl().GetWindowTextLength();
    GetEditCtrl().SetSel(tLen,tLen);
    GetEditCtrl().ReplaceSel(buffer);




    I get a new line but I also get some graphical character, looks like a l, and I don't want it!

    // Anders


    ---
    Thought I could organise freedom
    how Scandinavian of me

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

    Re: adding a new line in an editbox

    You haven't set your edit control to multiline...


    --
    Jason Teagle
    [email protected]

  3. #3
    Join Date
    Oct 1999
    Location
    USA
    Posts
    26

    Re: adding a new line in an editbox


    when you are working with edit controls
    new line character is "\r\n" not just"\n"
    try using "\r\n" wherever you need newline.

    Hope it helps.




    padma

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