officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-document-4133e4f2.md
Provides access to a collection of character styles in the current document.
Namespace : DevExpress.XtraRichEdit.API.Native
Assembly : DevExpress.RichEdit.v25.2.Core.dll
NuGet Package : DevExpress.RichEdit.Core
CharacterStyleCollection CharacterStyles { get; }
ReadOnly Property CharacterStyles As CharacterStyleCollection
| Type | Description |
|---|---|
| CharacterStyleCollection |
A CharacterStyleCollection collection containing character styles.
|
The following code snippets (auto-collected from DevExpress Examples) contain references to the CharacterStyles 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#L16
document.LoadDocument("Documents//Grimm.docx", DevExpress.XtraRichEdit.DocumentFormat.OpenXml);
CharacterStyle cstyle = document.CharacterStyles["MyCStyle"];
if (cstyle == null)
wpf-richedit-document-api/CS/DXRichEditControlAPISample/CodeExamples/StylesActions.cs#L16
document.LoadDocument("Documents//Grimm.docx", DevExpress.XtraRichEdit.DocumentFormat.OpenXml);
CharacterStyle cstyle = document.CharacterStyles["MyCStyle"];
if (cstyle == null)
word-document-api-examples/CS/CodeExamples/StylesActions.cs#L27
// Access the character style with the specified name.
CharacterStyle cstyle = document.CharacterStyles["MyCStyle"];
winforms-richedit-enable-line-numbering-and-count-document-rows/CS/LineNumberingExample/Form1.cs#L55
}
DevExpress.XtraRichEdit.API.Native.CharacterStyle style = richEditControl1.Document.CharacterStyles["Line Number"];
MyPagePainter customPagePainter = new MyPagePainter(richEditControl1, SystemColors.Info, style);
winforms-richedit-document-api/VB/RichEditAPISample/CodeExamples/Styles.vb#L15
document.LoadDocument("Documents//Grimm.docx", DevExpress.XtraRichEdit.DocumentFormat.OpenXml)
Dim cstyle As DevExpress.XtraRichEdit.API.Native.CharacterStyle = document.CharacterStyles("MyCStyle")
If cstyle Is Nothing Then
wpf-richedit-document-api/VB/DXRichEditControlAPISample/CodeExamples/StylesActions.vb#L13
document.LoadDocument("Documents//Grimm.docx", DevExpress.XtraRichEdit.DocumentFormat.OpenXml)
Dim cstyle As CharacterStyle = document.CharacterStyles("MyCStyle")
If cstyle Is Nothing Then
word-document-api-examples/VB/CodeExamples/StylesActions.vb#L26
' Access the character style with the specified name.
Dim cstyle As DevExpress.XtraRichEdit.API.Native.CharacterStyle = document.CharacterStyles("MyCStyle")
' If the style with the specified name does not exist
winforms-richedit-enable-line-numbering-and-count-document-rows/VB/LineNumberingExample/Form1.vb#L50
Dim style As API.Native.CharacterStyle = richEditControl1.Document.CharacterStyles("Line Number")
Dim customPagePainter As MyPagePainter = New MyPagePainter(richEditControl1, SystemColors.Info, style)
See Also