Thread: multiline richedit scrolling issue

  1. #1
    Registered User
    Join Date
    May 2002

    multiline richedit scrolling issue

    Whenever I send text into my richedit control, I also tell it to scroll to the bottom of the richedit (if needed) so then the data is always kept up to date (within view). Now the code works, but when it scrolls you have to click on the scrollbar because the last line of text appears at the top of the richedit instead of at the bottom, which is fixed by clicking on the scrollbar. Has anyone else experienced this type of problem, or know of a fix?


    totLines = SendMessage(window, EM_GETLINECOUNT, 0, 0);
    curLine = SendMessage(window, EM_GETTHUMB, 0, 0);
    SendMessage(window, EM_LINESCROLL, 0, totLines - curLine);

  2. #2
    Master of the Universe! velius's Avatar
    Join Date
    Sep 2003
    It would appear to be that you are progmatically telling the richedit control to scroll the total number of lines. If you know how many lines fit in the view then scroll to that many before the end.
    While you're breakin' down my back n'
    I been rackin' out my brain
    It don't matter how we make it
    'Cause it always ends the same
    You can push it for more mileage
    But your flaps r' wearin' thin
    And I could sleep on it 'til mornin'
    But this nightmare never ends
    Don't forget to call my lawyers
    With ridiculous demands
    An you can take the pity so far
    But it's more than I can stand
    'Cause this couchtrip's gettin' older
    Tell me how long has it been
    'Cause 5 years is forever
    An you haven't grown up yet
    -- You Could Be Mine - Guns N' Roses

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. float calculation issue
    By George2 in forum C# Programming
    Replies: 1
    Last Post: 05-26-2008, 04:56 AM
  2. type safe issue
    By George2 in forum C++ Programming
    Replies: 4
    Last Post: 02-12-2008, 09:32 PM
  3. Problems with my richedit...
    By tyouk in forum Windows Programming
    Replies: 2
    Last Post: 11-02-2003, 04:57 AM
  4. RichEdit Problem
    By dirkduck in forum Windows Programming
    Replies: 0
    Last Post: 07-24-2003, 05:50 PM
  5. my first issue of GDM
    By DavidP in forum A Brief History of
    Replies: 0
    Last Post: 09-12-2002, 04:02 PM