Baseline Property
- Namespace
TXTextControl
- Package
TXTextControl.asTextControl. WPF. SDK TXTextControl.from the private NuGet feed or Text Control Offline Packagesdll
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; }Public Property Baseline As IntegerExamples
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}");textControl.Text = "Quarterly results" & vbCrLf & "Revenue increased by 12%."
textControl.Select(0, 17)
Dim selection As 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.