TX Text Control .NET for Windows Forms

ParagraphStyle Constructor

Constructor|Introduced in 10.1
Namespace
TXTextControl
Package
TXTextControl.TextControl.WinForms.SDK as TXTextControl.dll from the private NuGet feed or Text Control Offline Packages

Description

Creates a new instance of the ParagraphStyle class.

Syntax

ParagraphStyle(string)

Creates a new instance of the ParagraphStyle class based on the TextControl root style named [Normal].

public ParagraphStyle(string name);
ParameterDescription
name

Specifies the new style's name.

ParagraphStyle(string, string)

Creates a new instance of the ParagraphStyle class based on the specified base style.

public ParagraphStyle(string name, string baseStyle);
ParameterDescription
name

Specifies the new style's name.

baseStyle

Specifies the name of the style the new style is based on.

ParagraphStyle(ParagraphStyle)

Creates a new root style that has all attributes of the specified style.

public ParagraphStyle(ParagraphStyle style);
ParameterDescription
style

Is a style the attributes of which are used to initialize the new style.

Examples

The following example creates and configures a reusable paragraph style for the document.

ParagraphStyle paragraphStyle = new("ReportHeading");
textControl.ParagraphStyles.Add(paragraphStyle);

Further Reading

  • Word Processing Basics: Using Style Sheets –
  • The ParagraphStyle and InlineStyle Constructor Unreveled –