TX Text Control .NET for Windows Forms

Baseline Property

Property
Namespace
TXTextControl
Package
TXTextControl.TextControl.WinForms.SDK as TXTextControl.dll from the private NuGet feed or Text Control Offline Packages

Description

Gets or sets the baseline alignment, in twips, of the selected text. Positive values moves the baseline to superscript, negative values move the baseline to subscript.

Syntax

public int Baseline { get; set; }

Examples

The following example formats the heading of a short document by using Selection.Baseline.

textControl.Text = "Quarterly results\nRevenue increased by 12%.";
textControl.Select(0, 17);
Selection selection = textControl.Selection;

selection.Baseline = 10;
Console.WriteLine($"Baseline used by Selection: {selection.Baseline}");

Limitations

Runtime only.

The property's value must be between -960 twips and 960 twips (48 pt).

Remarks

The property's default value is 0.

The property returns its default value when the text selection contains multiple characters with mixed baseline settings. The Selection.IsCommonValueSelected method can be used to check for mixed attributes.