New to Telerik UI for WinForms? Download free 30-day trial

History

The RadRichTextBox supports not only selection via the UI, but also programmatic selection. This topic will explain you how to:

Enable/Disable History

You can enable or disable the history for the RadDocument via the Enabled property of the DocumentHistory.

Enable history

this.radRichTextBox1.Document.History.Enabled = true;

Me.RadRichTextBox1.Document.History.Enabled = False

Clear History

To clear the history you just have to call the Clear() method of the DocumentHistory class.

Clear history

this.radRichTextBox1.Document.History.Clear();

Me.RadRichTextBox1.Document.History.Clear()

Undo/Redo

To undo and redo some actions, you can call the Undo() and Redo() methods of the RadRichTextBox.

Undo/Redo history

this.radRichTextBox1.Undo();
this.radRichTextBox1.Redo();

Me.RadRichTextBox1.Undo()
Me.RadRichTextBox1.Redo()

Change History Depth

To change the history capacity you have to set the desired value of the Depth property of the DocumentHistory. The default one is 1000.

History depth

this.radRichTextBox1.Document.History.Depth = 500;

Me.RadRichTextBox1.Document.History.Depth = 500

In this article