Skip to main content
.NET Framework 4.5.2+

Document.DefaultCharacterProperties Property

Provides access to default character formatting for the current document.

Namespace: DevExpress.XtraRichEdit.API.Native

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

Declaration

CharacterPropertiesBase DefaultCharacterProperties { get; }

Property Value

Type Description
CharacterPropertiesBase

A CharacterPropertiesBase interface that enables you to specify character properties.

Remarks

The DefaultCharacterProperties property enables you to specify default character formatting for a loaded or newly created document. These settings override the RichEditControlCompatibility.DefaultFontName and RichEditControlCompatibility.DefaultFontSize property values.

When formatting is reset by executing the ClearFormattingCommand, character properties are set to default values specified via the DefaultCharacterProperties property.

Example

The following code snippet illustrates how to apply default character formatting to a just loaded document. The RichEditControl.DocumentLoaded event is handled and the Document.DefaultCharacterProperties settings are modified.

Private Sub RichEditControl1_DocumentLoaded(ByVal sender As Object, ByVal e As EventArgs)
    richEditControl1.Document.DefaultCharacterProperties.FontName = "Arial"
    richEditControl1.Document.DefaultCharacterProperties.FontSize = 16
End Sub

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

See Also