Page 1 of 1

TRichViewEdit: Disable undo/redo completly

Posted: Thu Jun 21, 2018 2:34 pm
by Thris
Hello!

first at all. I extend your TRichViewEdit. It reads text from database and save it to database, but now i have a problem with the undo/redo list.

Example:
I write an formated text and let it save to database. Now if i reopen my appliaction the text load successful. If i want to remove the text i set the cursor at the end and press backspace. At this moment i get the errRVUndoEmpty exception, because the undo list is empty.

I dont need the undo/redo list. So my question: Is it possible to completly disable this function?

Re: TRichViewEdit: Disable undo/redo completly

Posted: Thu Jun 21, 2018 8:24 pm
by Sergey Tkachenko
To disable undo, assign rve.UndoLimit=0.

errRVUndoEmpty occurs when some editing methods are called in a wrong context. Probably, you called undocumented methods. The best way perform backspace is
SendMessage(rve.TopLevelEditor.Handle, WM_KEYDOWN, VK_BACK, 0)