TRichViewEdit: Disable undo/redo completly

General TRichView support forum. Please post your questions here
Post Reply
Thris
Posts: 1
Joined: Thu Jun 21, 2018 2:25 pm

TRichViewEdit: Disable undo/redo completly

Post 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?
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: TRichViewEdit: Disable undo/redo completly

Post 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)
Post Reply