The requested page is not available for the requested platform. You are viewing the content for .NET Framework 4.5.2+ platform.
.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+

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
<ComVisible(True)>
Public Interface ParagraphStyle
    Inherits ParagraphPropertiesWithTabs,
             ParagraphPropertiesBase,
             CharacterPropertiesBase
[ComVisible(true)]
public interface ParagraphStyle :
    ParagraphPropertiesWithTabs,
    ParagraphPropertiesBase,
    CharacterPropertiesBase
<ComVisible(True)>
Public Interface ParagraphStyle
    Inherits 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
See Also