Disable Undo/Redo temporarily

General TRichView support forum. Please post your questions here
Post Reply
tomr
Posts: 25
Joined: Wed Dec 09, 2020 9:36 am

Disable Undo/Redo temporarily

Post by tomr »

Hi Sergey,
I was wondering if there is a possible way to disable undo/redo temporarily. I want to make changes to a richedit and the specific changes should not be part of the undo list. Nevertheless i do not want to clear the undolist completly. Is there a lock function or anything else, I could use?

Best regards
Tom
standay
Posts: 274
Joined: Fri Jun 18, 2021 3:07 pm

Re: Disable Undo/Redo temporarily

Post by standay »

Tom, (not from Sergey!!)

I know you can use this:
Property UndoLimit sets the capacity of undo buffer. It can be used to disable undo/redo feature.
https://www.trichview.com/help/index.ht ... wedit.html

You'd probably have to set it to the current undo count:

Code: Select all

TRVEditRVData(rv.RVData).UndoList.Count
Maybe that will do it?

Stan
tomr
Posts: 25
Joined: Wed Dec 09, 2020 9:36 am

Re: Disable Undo/Redo temporarily

Post by tomr »

Hi Stan,
I really appreciate your help. I have tried your suggestion and it works fine. I was not sure if setting the count to 0, would reset the undo list.
It does not. After setting the count back to the count I saved temporaily my undo list was correct :D

Thank you.
Best regards
Tom
Post Reply