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. Scrolling to the bottom+colors

Scrolling to the bottom+colors

Scheduled Pinned Locked Moved C / C++ / MFC
question
2 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.
  • C Offline
    C Offline
    cowell
    wrote on last edited by
    #1

    2 questions 1) I have a Rich edit control in a dialog box. I add text to the end through a CString. I want to keep the scroll position it the bottom of the text. Whenever you call UpdateData (FALSE); it springs back to the top of the text. I've had a look at the setscrollpos, etc (that are in CWnd), but they are not very effective. 2) In the rich edit control i want to have different colours, but since the user does not enter text directly i use updatedata and all formatting is lost (and all text goes to the last setting used). Anyway around this? thanks

    P 1 Reply Last reply
    0
    • C cowell

      2 questions 1) I have a Rich edit control in a dialog box. I add text to the end through a CString. I want to keep the scroll position it the bottom of the text. Whenever you call UpdateData (FALSE); it springs back to the top of the text. I've had a look at the setscrollpos, etc (that are in CWnd), but they are not very effective. 2) In the rich edit control i want to have different colours, but since the user does not enter text directly i use updatedata and all formatting is lost (and all text goes to the last setting used). Anyway around this? thanks

      P Offline
      P Offline
      Philip Nicoletti
      wrote on last edited by
      #2

      for question #1 Have you tried the LineScroll() member function ? For example, after UpdateData(FALSE); int nVis = m_edit1c.GetFirstVisibleLine(); int nscroll = m_edit1c.GetLineCount() - nVis; m_edit1c.LineScroll(nscroll); (assuming that you have a control variable, m_edit1c, associated with the Rich edit control)

      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