officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-characterstylecollection.md
Creates a new character style.
Namespace : DevExpress.XtraRichEdit.API.Native
Assembly : DevExpress.RichEdit.v25.2.Core.dll
NuGet Package : DevExpress.RichEdit.Core
CharacterStyle CreateNew()
Function CreateNew As CharacterStyle
| Type | Description |
|---|---|
| CharacterStyle |
A CharacterStyle object representing a character style.
|
Use the CharacterStyleCollection.Add method to add a newly created style to the collection.
The following code snippets (auto-collected from DevExpress Examples) contain references to the CreateNew() method.
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#L19
{
cstyle = document.CharacterStyles.CreateNew();
cstyle.Name = "MyCStyle";
wpf-richedit-document-api/CS/DXRichEditControlAPISample/CodeExamples/StylesActions.cs#L19
{
cstyle = document.CharacterStyles.CreateNew();
cstyle.Name = "MyCStyle";
winforms-rich-edit-text-formatting/CS/Text Formatting Example/Form1.cs#L144
//to the custom paragraph style
CharacterStyle annotationCharStyle = document.CharacterStyles.CreateNew();
annotationCharStyle.Name = "AnnotationChar";
word-document-api-examples/CS/CodeExamples/StylesActions.cs#L33
{
cstyle = document.CharacterStyles.CreateNew();
cstyle.Name = "MyCStyle";
winforms-richedit-document-api/VB/RichEditAPISample/CodeExamples/Styles.vb#L17
If cstyle Is Nothing Then
cstyle = document.CharacterStyles.CreateNew()
cstyle.Name = "MyCStyle"
wpf-richedit-document-api/VB/DXRichEditControlAPISample/CodeExamples/StylesActions.vb#L15
If cstyle Is Nothing Then
cstyle = document.CharacterStyles.CreateNew()
cstyle.Name = "MyCStyle"
word-document-api-examples/VB/CodeExamples/StylesActions.vb#L30
If cstyle Is Nothing Then
cstyle = document.CharacterStyles.CreateNew()
cstyle.Name = "MyCStyle"
winforms-rich-edit-text-formatting/VB/Text Formatting Example/Form1.vb#L136
'to the custom paragraph style
Dim annotationCharStyle As CharacterStyle = document.CharacterStyles.CreateNew()
annotationCharStyle.Name = "AnnotationChar"
See Also
CharacterStyleCollection Interface