Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

Document.DefaultCharacterProperties Property

Provides access to default character formatting for the current document.

Namespace: DevExpress.XtraRichEdit.API.Native

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

NuGet Package: DevExpress.RichEdit.Core

#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.

View Example

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