multiline richedit scrolling issue

This is a discussion on multiline richedit scrolling issue within the Windows Programming forums, part of the Platform Specific Boards category; Whenever I send text into my richedit control, I also tell it to scroll to the bottom of the richedit ...

  1. #1
    Registered User
    Join Date
    May 2002
    Posts
    132

    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?

    Thanks

    Code:
    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
    Posts
    219
    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, 05: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, 06:50 PM
  5. my first issue of GDM
    By DavidP in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 09-12-2002, 05:02 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21