Setting Document Background and Editor Background in UI for WinForms RichTextEditor
Environment
| Product Version | Product | Author |
|---|---|---|
| 2025.3.812 | RichTextEditor for WinForms | Nadya Karaivanova |
Description
I want to set the document's background color to white and the editor's background color to gray in the RichTextEditor component of UI for WinForms.
This knowledge base article also answers the following questions:
- How to customize the background color of RichTextEditor pages?
- How to set different colors for the RichTextEditor editor and document?
- How to use PageBackColor and BackColor properties in UI for WinForms RichTextEditor?
Solution
To set the desired background colors for the document and editor:
- Use the
RichTextBoxElement.BackColorproperty to assign a color to the editor background. - Use the
RadRichTextEditor.PageBackColorproperty to assign a color to the document's background.
Example code:
// Set editor background color
this.radRichTextEditor1.RichTextBoxElement.BackColor = Color.LightGray;
// Set page background
this.radRichTextEditor1.PageBackColor = Color.White;