Back to Devexpress

Document.DefaultCharacterProperties Property

officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-document-6f103a7d.md

latest3.1 KB
Original Source

Document.DefaultCharacterProperties Property

Provides access to default character formatting for the current document.

Namespace : DevExpress.XtraRichEdit.API.Native

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

NuGet Package : DevExpress.RichEdit.Core

Declaration

csharp
CharacterPropertiesBase DefaultCharacterProperties { get; }
vb
ReadOnly Property DefaultCharacterProperties As CharacterPropertiesBase

Property Value

TypeDescription
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

vb
Private Sub RichEditControl1_DocumentLoaded(ByVal sender As Object, ByVal e As EventArgs)
    richEditControl1.Document.DefaultCharacterProperties.FontName = "Arial"
    richEditControl1.Document.DefaultCharacterProperties.FontSize = 16
End Sub
csharp
private void RichEditControl1_DocumentLoaded(object sender, EventArgs e) {
    richEditControl1.Document.DefaultCharacterProperties.FontName = "Arial";
    richEditControl1.Document.DefaultCharacterProperties.FontSize = 16;
}

See Also

Document Interface

Document Members

DevExpress.XtraRichEdit.API.Native Namespace