TX Text Control .NET for Windows Forms Documentation

ParagraphStyle Class

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.

Introduced: 10.1.

Syntax

[C#] public sealed class ParagraphStyle : FormattingStyle
[Visual Basic] Public NotInheritable Class ParagraphStyle Inherits FormattingStyle

Constructors

ConstructorDescription
ParagraphStyleInitializes a new instance of the ParagraphStyle class.

Properties

PropertyDescription
BaselineGets or sets the baseline alignment, in twips, of the style.
BoldGets or sets the bold attribute of the style.
FollowingStyleGets or sets the name of the style that TextControl automatically selects for the following paragraph after the user has pressed the ENTER key.
FontNameGets or sets the font of the style.
FontSizeGets or sets the font's size of the style.
ForeColorGets or sets the style's color used to display the text.
ItalicGets or sets the italic attribute of the style.
ListFormatGets or sets the style's bulleted or numbered list and/or its formatting attributes.
NameGets or sets the name of the style.
ParagraphFormatGets or sets the style's paragraph attributes.
StrikeoutGets or sets the strikeout attribute of the style.
TextBackColorGets or sets the style's text background color.
UnderlineGets or sets underlining styles for the style.

Methods

MethodDescription
ApplyApplies all set attributes of the style to the current document.

Example

The following example shows how to add and apply a ParagraphStyle.

[C#] 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";
[Visual Basic] 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"

See Also

 
 
 

Products

Support

Downloads

Corporate

Buy Now