Skip to main content
.NET Framework 4.5.2+

CharacterStyle Interface

Exposes methods and characteristics of a character style in a document.

Namespace: DevExpress.XtraRichEdit.API.Native

Assembly: DevExpress.RichEdit.v22.1.Core.dll


public interface CharacterStyle :


A style pertains to a document. It belongs to a particular document model, and you cannot add a style object from the style collection of one document to the style collection of another.

Document document = server.Document;
server.LoadDocument("Documents\\Grimm.docx", DocumentFormat.OpenXml);
CharacterStyle cstyle = document.CharacterStyles["MyCStyle"];
if (cstyle == null)
    cstyle = document.CharacterStyles.CreateNew();
    cstyle.Name = "MyCStyle";
    cstyle.Parent = document.CharacterStyles["Default Paragraph Font"];
    cstyle.ForeColor = System.Drawing.Color.DarkOrange;
    cstyle.Strikeout = StrikeoutType.Double;
    cstyle.FontName = "Verdana";
DocumentRange myRange = document.Paragraphs[0].Range;
CharacterProperties charProps =
charProps.Style = cstyle;

The following code snippets (auto-collected from DevExpress Examples) contain references to the CharacterStyle interface.


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.

See Also