Skip to content

Commit e9fb13c

Browse files
authored
Merge pull request #791 from telerik/new-kb-richtexteditor-set-background-colors-c1672cfdac4b422aa18bb1c1b363c926
Added new kb article richtexteditor-set-background-colors
2 parents 98e402f + 4ae4099 commit e9fb13c

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
title: Setting Document Background and Editor Background in UI for WinForms RichTextEditor
3+
description: Learn how to set the document background and the editor background in UI for WinForms RichTextEditor.
4+
type: how-to
5+
page_title: How to Change Document and Editor Background Colors in UI for WinForms RichTextEditor
6+
meta_title: How to Change Document and Editor Background Colors in UI for WinForms RichTextEditor
7+
slug: richtexteditor-set-background-colors
8+
tags: richtexteditor, ui for winforms, document background, editor background, pagebackcolor, backcolor
9+
res_type: kb
10+
ticketid: 1700509
11+
---
12+
13+
## Environment
14+
15+
|Product Version|Product|Author|
16+
|----|----|----|
17+
|2025.3.812|RichTextEditor for WinForms|[Nadya Karaivanova](https://www.telerik.com/blogs/author/nadya-karaivanova)|
18+
19+
## Description
20+
21+
I want to set the document's background color to white and the editor's background color to gray in the [RichTextEditor](https://docs.telerik.com/devtools/winforms/controls/richtexteditor/overview) component of UI for WinForms.
22+
23+
This knowledge base article also answers the following questions:
24+
- How to customize the background color of RichTextEditor pages?
25+
- How to set different colors for the RichTextEditor editor and document?
26+
- How to use PageBackColor and BackColor properties in UI for WinForms RichTextEditor?
27+
28+
## Solution
29+
30+
To set the desired background colors for the document and editor:
31+
32+
1. Use the `RichTextBoxElement.BackColor` property to assign a color to the editor background.
33+
2. Use the `RadRichTextEditor.PageBackColor` property to assign a color to the document's background.
34+
35+
Example code:
36+
37+
````C#
38+
39+
// Set editor background color
40+
this.radRichTextEditor1.RichTextBoxElement.BackColor = Color.LightGray;
41+
42+
// Set page background
43+
this.radRichTextEditor1.PageBackColor = Color.White;
44+
45+
````
46+
47+
## See Also
48+
49+
* [RichTextEditor Overview](https://docs.telerik.com/devtools/winforms/controls/richtexteditor/overview)

0 commit comments

Comments
 (0)