TX Text Control .NET for Windows Forms

FormattingStyle Class

Class|Introduced in 10.1
Namespace
TXTextControl
Package
TXTextControl.TextControl.WinForms.SDK from the private NuGet feed or Text Control Offline Packages
Assembly
TXTextControl.dll
Install
dotnet add package TXTextControl.TextControl.WinForms.SDK .NET 8 and later. For .NET Framework, reference TXTextControl.dll from the setup.
Derived
InlineStyle, ParagraphStyle

Description

The FormattingStyle class is the base class for the InlineStyle and ParagraphStyle classes. It implements the functionality common to all formatting styles.

Syntax

public class FormattingStyle

Examples

The following example creates a reusable emphasis style and adds it to the document.

FormattingStyle formattingStyle = new InlineStyle("Emphasis");
textControl.InlineStyles.Add((InlineStyle)formattingStyle);

Members

Properties

PropertyDescription
AutoBaselineGets 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.
BaselineGets 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.
BaseStyleGets 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.
BoldGets or sets the bold attribute of the style.
CapitalsGets 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).
CharacterScalingGets or sets the style's character scaling, in percent of the average character width.
CharacterSpacingGets 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.
CultureGets or sets the style's culture. When this property is null, the style has the neutral culture.
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.
NameGets or sets the name of the style.
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.

Further Reading