officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-characterpropertiesbase-d85a6405.md
Gets or sets the foreground color of characters.
Namespace : DevExpress.XtraRichEdit.API.Native
Assembly : DevExpress.RichEdit.v25.2.Core.dll
NuGet Package : DevExpress.RichEdit.Core
Color? ForeColor { get; set; }
Property ForeColor As Color?
| Type | Description |
|---|---|
| Nullable<Color> |
A Color value representing the foreground color, or null for a mixture of values.
|
Use the CharacterProperties interface to change character formatting.
If the CharacterPropertiesBase.ForeColor is not set explicitly, the AppearanceObject.ForeColor property value is in effect. Modification of the ForeColor applies changes to the CharacterPropertiesBase.ForeColor property of characters with an unspecified foreground color.
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 rendering and export.
The following code snippets (auto-collected from DevExpress Examples) contain references to the ForeColor 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-richedit-document-api/CS/RichEditAPISample/CodeExamples/Styles.cs#L22
cstyle.Parent = document.CharacterStyles["Default Paragraph Font"];
cstyle.ForeColor = System.Drawing.Color.DarkOrange;
cstyle.Strikeout = StrikeoutType.Double;
wpf-richedit-document-api/CS/DXRichEditControlAPISample/CodeExamples/FormattingActions.cs#L19
cp.FontSize = 18;
cp.ForeColor = Color.Blue;
cp.BackColor = Color.Snow;
word-document-api-examples/CS/CodeExamples/StylesActions.cs#L36
cstyle.Parent = document.CharacterStyles["Default Paragraph Font"];
cstyle.ForeColor = System.Drawing.Color.DarkOrange;
cstyle.Strikeout = StrikeoutType.Double;
winforms-rich-edit-text-formatting/CS/Text Formatting Example/Form1.cs#L53
titleFormatting.FontName = "Helvetica";
titleFormatting.ForeColor = Color.DarkBlue;
winforms-richedit-table-of-contents-practical-guide/CS/Form1.cs#L96
cp.FontSize = 12;
cp.ForeColor = Color.Blue;
Document.EndUpdateCharacters(cp);
winforms-richedit-document-api/VB/RichEditAPISample/CodeExamples/Styles.vb#L20
cstyle.Parent = document.CharacterStyles("Default Paragraph Font")
cstyle.ForeColor = System.Drawing.Color.DarkOrange
cstyle.Strikeout = DevExpress.XtraRichEdit.API.Native.StrikeoutType.[Double]
wpf-richedit-document-api/VB/DXRichEditControlAPISample/CodeExamples/FormattingActions.vb#L16
cp.FontSize = 18
cp.ForeColor = Color.Blue
cp.BackColor = Color.Snow
word-document-api-examples/VB/CodeExamples/StylesActions.vb#L33
cstyle.Parent = document.CharacterStyles("Default Paragraph Font")
cstyle.ForeColor = System.Drawing.Color.DarkOrange
cstyle.Strikeout = DevExpress.XtraRichEdit.API.Native.StrikeoutType.[Double]
winforms-rich-edit-text-formatting/VB/Text Formatting Example/Form1.vb#L50
titleFormatting.FontName = "Helvetica"
titleFormatting.ForeColor = Color.DarkBlue
winforms-richedit-table-of-contents-practical-guide/VB/Form1.vb#L88
cp.FontSize = 12
cp.ForeColor = Color.Blue
Document.EndUpdateCharacters(cp)
See Also
CharacterPropertiesBase Interface