Back to Devexpress

CharacterStyle.Parent Property

officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-characterstyle.md

latest4.3 KB
Original Source

CharacterStyle.Parent Property

Gets or sets the style form which the current style inherits.

Namespace : DevExpress.XtraRichEdit.API.Native

Assembly : DevExpress.RichEdit.v25.2.Core.dll

NuGet Package : DevExpress.RichEdit.Core

Declaration

csharp
CharacterStyle Parent { get; set; }
vb
Property Parent As CharacterStyle

Property Value

TypeDescription
CharacterStyle

A CharacterStyle object representing the parent style.

|

Remarks

When creating a new style, you do not have to specify all formatting properties. Instead you can specify the parent style and change only the required properties.

The following code snippets (auto-collected from DevExpress Examples) contain references to the Parent 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#L21

csharp
cstyle.Name = "MyCStyle";
cstyle.Parent = document.CharacterStyles["Default Paragraph Font"];
cstyle.ForeColor = System.Drawing.Color.DarkOrange;

wpf-richedit-document-api/CS/DXRichEditControlAPISample/CodeExamples/StylesActions.cs#L21

csharp
cstyle.Name = "MyCStyle";
cstyle.Parent = document.CharacterStyles["Default Paragraph Font"];
cstyle.ForeColor = System.Drawing.Color.DarkOrange;

word-document-api-examples/CS/CodeExamples/StylesActions.cs#L35

csharp
cstyle.Name = "MyCStyle";
cstyle.Parent = document.CharacterStyles["Default Paragraph Font"];
cstyle.ForeColor = System.Drawing.Color.DarkOrange;

winforms-richedit-document-api/VB/RichEditAPISample/CodeExamples/Styles.vb#L19

vb
cstyle.Name = "MyCStyle"
cstyle.Parent = document.CharacterStyles("Default Paragraph Font")
cstyle.ForeColor = System.Drawing.Color.DarkOrange

wpf-richedit-document-api/VB/DXRichEditControlAPISample/CodeExamples/StylesActions.vb#L17

vb
cstyle.Name = "MyCStyle"
cstyle.Parent = document.CharacterStyles("Default Paragraph Font")
cstyle.ForeColor = System.Drawing.Color.DarkOrange

word-document-api-examples/VB/CodeExamples/StylesActions.vb#L32

vb
cstyle.Name = "MyCStyle"
cstyle.Parent = document.CharacterStyles("Default Paragraph Font")
cstyle.ForeColor = System.Drawing.Color.DarkOrange

See Also

CharacterStyle Interface

CharacterStyle Members

DevExpress.XtraRichEdit.API.Native Namespace