TX Text Control .NET Server

InlineStyle Class

Class|Introduced in 10.1
Namespace
TXTextControl
Package
TXTextControl.TextControl.Core.SDK from the private NuGet feed or Text Control Offline Packages
Assembly
TXTextControl.Core.dll
Install
dotnet add package TXTextControl.TextControl.Core.SDK .NET 8 and later. For .NET Framework, reference TXTextControl.dll from the setup.
Also in
TXTextControl.TextControl.ASP.SDK as TXTextControl.dll
Inherits
  1. FormattingStyle
  2. InlineStyle

Description

The InlineStyle class defines a formatting style that can be used to format single words in a line of text. In addition to the methods described here, it inherits all properties and methods of the FormattingStyle class.

Syntax

public sealed class InlineStyle : FormattingStyle

Examples

The following example shows how to add and apply an InlineStyle.

textControl1.Text = "TX Text Control";

TXTextControl.InlineStyle inline = new TXTextControl.InlineStyle("ArialBold16");
inline.Bold = true;
inline.FontSize = 320;
inline.FontName = "Arial";
textControl1.InlineStyles.Add(inline);

textControl1.Select(3, 4);
textControl1.Selection.FormattingStyle = "ArialBold16";

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

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

Members

Constructors

ConstructorDescription
InlineStyleCreates a new instance of the InlineStyle class.

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. (Inherited from FormattingStyle.)
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. (Inherited from FormattingStyle.)
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. (Inherited from FormattingStyle.)
BoldGets or sets the bold attribute of the style. (Inherited from FormattingStyle.)
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). (Inherited from FormattingStyle.)
CharacterScalingGets or sets the style's character scaling, in percent of the average character width. (Inherited from FormattingStyle.)
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. (Inherited from FormattingStyle.)
CultureGets or sets the style's culture. When this property is null, the style has the neutral culture. (Inherited from FormattingStyle.)
FontNameGets or sets the font of the style. (Inherited from FormattingStyle.)
FontSizeGets or sets the font's size of the style. (Inherited from FormattingStyle.)
ForeColorGets or sets the style's color used to display the text. (Inherited from FormattingStyle.)
ItalicGets or sets the italic attribute of the style. (Inherited from FormattingStyle.)
NameGets or sets the name of the style. (Inherited from FormattingStyle.)
StrikeoutGets or sets the strikeout attribute of the style. (Inherited from FormattingStyle.)
TextBackColorGets or sets the style's text background color. (Inherited from FormattingStyle.)
UnderlineGets or sets underlining styles for the style. (Inherited from FormattingStyle.)

Methods

MethodDescription
ApplyApplies all set attributes of the style to the current document. (Inherited from FormattingStyle.)
IsInheritedFromParagraphInforms about whether one or more of the style's attributes are inherited from the surrounding paragraph. Text formatted through an inline style has all the attributes defined through the surrounding paragraph except the attributes explicitly defined through the inline style.
ResetToParagraphResets one or more of the style's attributes to its default value which is the same value as defined for the surrounding paragraph. Text formatted through an inline style has all the attributes defined through the surrounding paragraph except the attributes explicitly defined through the inline style.

Enumerations

EnumerationDescription
AttributesDetermines the style's attributes. This enumeration is used with the IsInheritedFromParagraph and ResetToParagraph methods.