Back to Devexpress

Document.DefaultParagraphProperties Property

officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-document-85a72d84.md

latest2.8 KB
Original Source

Document.DefaultParagraphProperties Property

Provides access to default paragraph formatting for the current document.

Namespace : DevExpress.XtraRichEdit.API.Native

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

NuGet Package : DevExpress.RichEdit.Core

Declaration

csharp
ParagraphPropertiesBase DefaultParagraphProperties { get; }
vb
ReadOnly Property DefaultParagraphProperties As ParagraphPropertiesBase

Property Value

TypeDescription
ParagraphPropertiesBase

A ParagraphPropertiesBase interface that enables you to specify paragraph properties.

|

Example

The following code snippet illustrates how to apply default character and paragraph formatting to a newly created document. The RichEditControl.EmptyDocumentCreated event is handled and the Document.DefaultParagraphProperties and Document.DefaultCharacterProperties settings are modified.

View Example

vb
Private Sub RichEditControl1_EmptyDocumentCreated(ByVal sender As Object, ByVal e As EventArgs)
    richEditControl1.Document.DefaultCharacterProperties.ForeColor = Color.Red
    richEditControl1.Document.DefaultParagraphProperties.Alignment = DevExpress.XtraRichEdit.API.Native.ParagraphAlignment.Center
    richEditControl1.Document.AppendText("Document created at " & Date.Now.ToLongTimeString())
End Sub
csharp
private void RichEditControl1_EmptyDocumentCreated(object sender, EventArgs e) {
    richEditControl1.Document.DefaultCharacterProperties.ForeColor = Color.Red;
    richEditControl1.Document.DefaultParagraphProperties.Alignment = DevExpress.XtraRichEdit.API.Native.ParagraphAlignment.Center;
    richEditControl1.Document.AppendText("Document created at " + DateTime.Now.ToLongTimeString());
}

See Also

Document Interface

Document Members

DevExpress.XtraRichEdit.API.Native Namespace