Back to Devexpress

ParagraphStyleCollection.CreateNew() Method

officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-paragraphstylecollection.md

latest5.7 KB
Original Source

ParagraphStyleCollection.CreateNew() Method

Creates a new paragraph style.

Namespace : DevExpress.XtraRichEdit.API.Native

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

NuGet Package : DevExpress.RichEdit.Core

Declaration

csharp
ParagraphStyle CreateNew()
vb
Function CreateNew As ParagraphStyle

Returns

TypeDescription
ParagraphStyle

A ParagraphStyle object representing a paragraph style.

|

Remarks

Use the ParagraphStyleCollection.Add method to add a newly created style to the collection.

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

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.

winforms-rich-edit-text-formatting/CS/Text Formatting Example/Form1.cs#L96

csharp
//and specify the required properties
ParagraphStyle chapterStyle = document.ParagraphStyles.CreateNew();
chapterStyle.Name = "MyTitleStyle";

winforms-richedit-document-api/CS/RichEditAPISample/CodeExamples/Styles.cs#L42

csharp
{
    pstyle = document.ParagraphStyles.CreateNew();
    pstyle.Name = "MyPStyle";

wpf-richedit-document-api/CS/DXRichEditControlAPISample/CodeExamples/StylesActions.cs#L42

csharp
{
    pstyle = document.ParagraphStyles.CreateNew();
    pstyle.Name = "MyPStyle";

winforms-richedit-table-of-contents-practical-guide/CS/Form1.cs#L118

csharp
if (paragraphStyle == null) {
    paragraphStyle = Document.ParagraphStyles.CreateNew();
    paragraphStyle.Name = styleName;

word-document-api-examples/CS/CodeExamples/StylesActions.cs#L74

csharp
{
    pstyle = document.ParagraphStyles.CreateNew();
    pstyle.Name = "MyPStyle";

winforms-rich-edit-text-formatting/VB/Text Formatting Example/Form1.vb#L91

vb
'and specify the required properties
Dim chapterStyle As ParagraphStyle = document.ParagraphStyles.CreateNew()
chapterStyle.Name = "MyTitleStyle"

winforms-richedit-document-api/VB/RichEditAPISample/CodeExamples/Styles.vb#L38

vb
If pstyle Is Nothing Then
    pstyle = document.ParagraphStyles.CreateNew()
    pstyle.Name = "MyPStyle"

wpf-richedit-document-api/VB/DXRichEditControlAPISample/CodeExamples/StylesActions.vb#L35

vb
If pstyle Is Nothing Then
    pstyle = document.ParagraphStyles.CreateNew()
    pstyle.Name = "MyPStyle"

word-document-api-examples/VB/CodeExamples/StylesActions.vb#L62

vb
If pstyle Is Nothing Then
    pstyle = document.ParagraphStyles.CreateNew()
    pstyle.Name = "MyPStyle"

winforms-richedit-table-of-contents-practical-guide/VB/Form1.vb#L109

vb
If paragraphStyle Is Nothing Then
    paragraphStyle = Document.ParagraphStyles.CreateNew()
    paragraphStyle.Name = styleName

See Also

Add(ParagraphStyle)

ParagraphStyleCollection Interface

ParagraphStyleCollection Members

DevExpress.XtraRichEdit.API.Native Namespace