Skip to main content
A newer version of this page is available. .
.NET Framework 4.5.2+

ParagraphStyle Interface

Exposes methods and characteristics of a paragraph style in a document.

Namespace: DevExpress.XtraRichEdit.API.Native

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

Declaration

[ComVisible(true)]
public interface ParagraphStyle :
    ParagraphPropertiesWithTabs,
    ParagraphPropertiesBase,
    CharacterPropertiesBase

Remarks

A style pertains to a document. It belongs to a particular document model and you cannot just add the style object from a style collection of one document to the style collection of another document.

The following code snippet creates a new paragraph style via the ParagraphStyleCollection.CreateNew method, specifies style settings, adds it to the document style collection and applies the style to the currently selected paragraph.

document.LoadDocument("Grimm.docx", DevExpress.XtraRichEdit.DocumentFormat.OpenXml)
Dim pstyle As ParagraphStyle = document.ParagraphStyles("MyPStyle")
If pstyle Is Nothing Then
    pstyle = document.ParagraphStyles.CreateNew()
    pstyle.Name = "MyPStyle"
    pstyle.LineSpacingType = ParagraphLineSpacing.Double
    pstyle.Alignment = ParagraphAlignment.Center
    document.ParagraphStyles.Add(pstyle)
End If
document.Paragraphs(2).Style = pstyle

The following code snippets (auto-collected from DevExpress Examples) contain references to the ParagraphStyle interface.

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