officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-characterpropertiesbase-4418e8a2.md
Gets or sets the background color of character(s).
Namespace : DevExpress.XtraRichEdit.API.Native
Assembly : DevExpress.RichEdit.v25.2.Core.dll
NuGet Package : DevExpress.RichEdit.Core
Color? BackColor { get; set; }
Property BackColor As Color?
| Type | Description |
|---|---|
| Nullable<Color> |
A Color value representing the background color or null for mixed colors.
|
Use the CharacterProperties interface to change character formatting.
Important
The semi-transparent alpha component (i.e. the Color’s alpha parameter set to value less than 255) is reset to opaque (255) during export to all formats except PDF.
The following code snippets (auto-collected from DevExpress Examples) contain references to the BackColor property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
winforms-grid-richedit-highlight-search-results/CS/E4422/Form1.cs#L26
CharacterProperties cp = document.BeginUpdateCharacters(ranges[i]);
cp.BackColor = LookAndFeelHelper.GetHighlightSearchAppearance(UserLookAndFeel.Default, false).BackColor;
document.EndUpdateCharacters(cp);
winforms-richedit-customize-popup-menu/CS/RichEditContextMenu/Form1.cs#L67
CharacterProperties charProps = richEditControl.Document.BeginUpdateCharacters(richEditControl.Document.Selection);
charProps.BackColor = System.Drawing.Color.Yellow;
richEditControl.Document.EndUpdateCharacters(charProps);
winforms-richedit-document-api/CS/RichEditAPISample/CodeExamples/Formatting.cs#L25
cp.ForeColor = Color.Blue;
cp.BackColor = Color.Snow;
cp.Underline = UnderlineType.DoubleWave;
winforms-richedit-iterate-through-all-sub-documents/CS/Form1.cs#L49
cp.ForeColor = Color.Red;
cp.BackColor = Color.Lavender;
subdoc.EndUpdateCharacters(cp);
wpf-richedit-document-api/CS/DXRichEditControlAPISample/CodeExamples/FormattingActions.cs#L20
cp.ForeColor = Color.Blue;
cp.BackColor = Color.Snow;
cp.Underline = UnderlineType.DoubleWave;
winforms-grid-richedit-highlight-search-results/VB/E4422/Form1.vb#L29
Dim cp As CharacterProperties = document.BeginUpdateCharacters(ranges(i))
cp.BackColor = LookAndFeelHelper.GetHighlightSearchAppearance(UserLookAndFeel.Default, False).BackColor
document.EndUpdateCharacters(cp)
winforms-richedit-customize-popup-menu/VB/RichEditContextMenu/Form1.vb#L61
Dim charProps As CharacterProperties = richEditControl.Document.BeginUpdateCharacters(richEditControl.Document.Selection)
charProps.BackColor = System.Drawing.Color.Yellow
richEditControl.Document.EndUpdateCharacters(charProps)
winforms-richedit-document-api/VB/RichEditAPISample/CodeExamples/Formatting.vb#L23
cp.ForeColor = System.Drawing.Color.Blue
cp.BackColor = System.Drawing.Color.Snow
cp.Underline = DevExpress.XtraRichEdit.API.Native.UnderlineType.DoubleWave
winforms-richedit-iterate-through-all-sub-documents/VB/Form1.vb#L37
cp.ForeColor = Color.Red
cp.BackColor = Color.Lavender
subdoc.EndUpdateCharacters(cp)
wpf-richedit-document-api/VB/DXRichEditControlAPISample/CodeExamples/FormattingActions.vb#L17
cp.ForeColor = Color.Blue
cp.BackColor = Color.Snow
cp.Underline = UnderlineType.DoubleWave
See Also
CharacterPropertiesBase Interface