ParagraphStyle Class
- Namespace
TXTextControl
- Package
TXTextControl.from the private NuGet feed or Text Control Offline PackagesTextControl. WinForms. SDK
- Assembly
TXTextControl.dll
- Install
dotnet add package TXTextControl..NET 8 and later. For .NET Framework, referenceTextControl. WinForms. SDK TXTextControl.from the setup.dll
- Inherits
- Formatting
Style - Paragraph
Style
- Formatting
Description
The ParagraphStyle class defines a formatting style for paragraphs. In addition to the properties described here, it inherits all properties and methods of the FormattingStyle class.
Syntax
public sealed class ParagraphStyle : FormattingStylePublic NotInheritable Class ParagraphStyle
Inherits FormattingStyleExamples
The following example shows how to add and apply a ParagraphStyle.
textControl1.Text = "TX Text Control";
TXTextControl.ParagraphStyle par = new TXTextControl.ParagraphStyle("CenterBold");
par.Bold = true;
par.ParagraphFormat.Alignment = TXTextControl.HorizontalAlignment.Center;
textControl1.ParagraphStyles.Add(par);
textControl1.Select(0,0);
textControl1.Selection.FormattingStyle = "CenterBold";TextControl1.Text = "TX Text Control"
Dim par As TXTextControl.ParagraphStyle = New TXTextControl.ParagraphStyle("CenterBold")
par.Bold = True
par.ParagraphFormat.Alignment = TXTextControl.HorizontalAlignment.Center
TextControl1.ParagraphStyles.Add(par)
TextControl1.Select(0, 0)
TextControl1.Selection.FormattingStyle = "CenterBold"The following example creates and configures a reusable paragraph style for the document.
ParagraphStyle paragraphStyle = new("ReportHeading");
textControl.ParagraphStyles.Add(paragraphStyle);Dim paragraphStyle As New ParagraphStyle("ReportHeading")
textControl.ParagraphStyles.Add(paragraphStyle)Members
Constructors
| Constructor | Description |
|---|---|
| ParagraphStyle | Creates a new instance of the ParagraphStyle class. |
Properties
| Property | Description |
|---|---|
| AutoBaseline | Gets or sets values specifying automatic sub- or superscripted text. When using automatic sub- and superscript the font is scaled and moved above or below the baseline with values defined through the font itself. Automatic sub- and superscript can be combined with a user-defined baseline which can be set with the Baseline property. (Inherited from FormattingStyle.) |
| Baseline | Gets or sets a user-defined baseline alignment, in twips, of the style. Positive values moves the baseline to superscript, negative values move the baseline to subscript. (Inherited from FormattingStyle.) |
| BaseStyle | Gets the FormattingStyle which is the base style of this style. If this style is the TextControl's root style this property returns null. The property's value can be either a ParagraphStyle or an InlineStyle. (Inherited from FormattingStyle.) |
| Bold | Gets or sets the bold attribute of the style. (Inherited from FormattingStyle.) |
| Capitals | Gets or sets values specifying wheather lowercase letters are displayed with capital letters. Lowercase letters are displayed either with capital letters of the same size or with capital letters which have a smaller size. The smaller size is either the size of the lowercase 'x' (petite caps) or the size of the lowercase 'x' + 10% (small caps). (Inherited from FormattingStyle.) |
| CharacterScaling | Gets or sets the style's character scaling, in percent of the average character width. (Inherited from FormattingStyle.) |
| CharacterSpacing | Gets or sets the style's character spacing value, in twips. This value is added to each character. When it is negative, character spacing is reduced, otherwise it is extended. (Inherited from FormattingStyle.) |
| Culture | Gets or sets the style's culture. When this property is null, the style has the neutral culture. (Inherited from FormattingStyle.) |
| FollowingStyle | Gets or sets the name of the style that TextControl automatically selects for the following paragraph after the user has pressed the ENTER key. |
| FontName | Gets or sets the font of the style. (Inherited from FormattingStyle.) |
| FontSize | Gets or sets the font's size of the style. (Inherited from FormattingStyle.) |
| ForeColor | Gets or sets the style's color used to display the text. (Inherited from FormattingStyle.) |
| Italic | Gets or sets the italic attribute of the style. (Inherited from FormattingStyle.) |
| ListFormat | Gets or sets the style's bulleted or numbered list and/or its formatting attributes. The property's value is an object of the type ListFormat. |
| Name | Gets or sets the name of the style. (Inherited from FormattingStyle.) |
| ParagraphFormat | Gets or sets the style's paragraph attributes. The property's value is an object of the type ParagraphFormat. |
| Strikeout | Gets or sets the strikeout attribute of the style. (Inherited from FormattingStyle.) |
| TextBackColor | Gets or sets the style's text background color. (Inherited from FormattingStyle.) |
| Underline | Gets or sets underlining styles for the style. (Inherited from FormattingStyle.) |
Methods
| Method | Description |
|---|---|
| Apply | Applies all set attributes of the style to the current document. (Inherited from FormattingStyle.) |