Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Scroll bars!

Scroll bars!

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W Offline
    W Offline
    wilche
    wrote on last edited by
    #1

    G'day all! I have been using CRichEditCtrl class and every 20ms or so, I add things on to the display using this class. So you can imagine there's a whole heap of lines in the display. I have been trying very hard to make sure that the Vertical Scroll Bar is placed at the latest updated position. Could anyone help me with this one? Any help will be appreciated! This above all, to thine own self be TRUE. William Shakespeare

    E 1 Reply Last reply
    0
    • W wilche

      G'day all! I have been using CRichEditCtrl class and every 20ms or so, I add things on to the display using this class. So you can imagine there's a whole heap of lines in the display. I have been trying very hard to make sure that the Vertical Scroll Bar is placed at the latest updated position. Could anyone help me with this one? Any help will be appreciated! This above all, to thine own self be TRUE. William Shakespeare

      E Offline
      E Offline
      Ernest Laurentin
      wrote on last edited by
      #2

      I didn't try the following but I believe it should work: 1) Call long GetTextLength() to get number character 2) Call long LineFromChar( long nIndex ) to get line index 3) You may want to call LineLength() to get line length 4) Call LineScroll() by removing the offset of the GetFirstVisibleLine( ).

      CRichEditCtrl ctrl; // you have something like that somewhere...
      int nLine = ctrl.LineFromChar(ctrl.GetTextLength());
      ctrl.LineScroll(nLine-ctrl.GetFirsVisibleLine());

      Good luck! One good thing about getting older, you don't lose the ages you've been!

      W 1 Reply Last reply
      0
      • E Ernest Laurentin

        I didn't try the following but I believe it should work: 1) Call long GetTextLength() to get number character 2) Call long LineFromChar( long nIndex ) to get line index 3) You may want to call LineLength() to get line length 4) Call LineScroll() by removing the offset of the GetFirstVisibleLine( ).

        CRichEditCtrl ctrl; // you have something like that somewhere...
        int nLine = ctrl.LineFromChar(ctrl.GetTextLength());
        ctrl.LineScroll(nLine-ctrl.GetFirsVisibleLine());

        Good luck! One good thing about getting older, you don't lose the ages you've been!

        W Offline
        W Offline
        wilche
        wrote on last edited by
        #3

        Thank you Ernest! It works great, thanks! Life is like fishing. We are all waiting for a bite

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups