FontSize Property
- Namespace
TXTextControl
- Package
TXTextControl.asTextControl. WPF. SDK TXTextControl.from the private NuGet feed or Text Control Offline Packagesdll
Description
Gets or sets the font's size, in twips, of the selected text.
Syntax
public int FontSize { get; set; }Public Property FontSize As IntegerExamples
The following example formats the heading of a short document by using Selection.FontSize.
textControl.Text = "Quarterly results\nRevenue increased by 12%.";
textControl.Select(0, 17);
Selection selection = textControl.Selection;
selection.FontSize = 10;
Console.WriteLine($"Font Size used by Selection: {selection.FontSize}");textControl.Text = "Quarterly results" & vbCrLf & "Revenue increased by 12%."
textControl.Select(0, 17)
Dim selection As Selection = textControl.Selection
selection.FontSize = 10
Console.WriteLine($"Font Size used by Selection: {selection.FontSize}")Limitations
Runtime only.
Remarks
The property's default value is 200 twips, which equals 10 points.
The property returns its default value when the text selection contains multiple characters with mixed font sizes. The Selection.IsCommonValueSelected method can be used to check for mixed attributes.