RichTextEdit controls
The UndoDepth property specifies the maximum number of editing changes that the Undo function will undo. Each time you call Undo, one more editing change is restored. The CanUndo function returns false when there are no more changes to undo.