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. In MFC how to achieve multilevel undo/redo operations for CRichEditCtrl?

In MFC how to achieve multilevel undo/redo operations for CRichEditCtrl?

Scheduled Pinned Locked Moved C / C++ / MFC
c++tutorialquestion
3 Posts 3 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.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    I am typing the text and changing the color using SetSel() and SetSelectionFormat().On clicking ctrl+z single time I need to delete that text.I dont want to remember SetSel() and SetSelectionFormat() operations for undo. When I do ctrl+z second time, I need to do redo operation? How to achieve this? Or How to achieve multilevel undo/redo operations for CRichEditCtrl?

    V _ 2 Replies Last reply
    0
    • L Lost User

      I am typing the text and changing the color using SetSel() and SetSelectionFormat().On clicking ctrl+z single time I need to delete that text.I dont want to remember SetSel() and SetSelectionFormat() operations for undo. When I do ctrl+z second time, I need to do redo operation? How to achieve this? Or How to achieve multilevel undo/redo operations for CRichEditCtrl?

      V Offline
      V Offline
      Victor Nijegorodov
      wrote on last edited by
      #2

      Have a look at [Undo/Redo Manager](https://www.codeguru.com/cpp/misc/misc/article.php/c399/UndoRedo-Manager.htm)

      1 Reply Last reply
      0
      • L Lost User

        I am typing the text and changing the color using SetSel() and SetSelectionFormat().On clicking ctrl+z single time I need to delete that text.I dont want to remember SetSel() and SetSelectionFormat() operations for undo. When I do ctrl+z second time, I need to do redo operation? How to achieve this? Or How to achieve multilevel undo/redo operations for CRichEditCtrl?

        _ Offline
        _ Offline
        _Flaviu
        wrote on last edited by
        #3

        You can find here a sample of how to use CRichEditCtrl with multiple level of undo/redo operations: How to Use RichEditControl 4.1 in CRichEditView[^].

        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