TX Text Control .NET for Windows Forms

Capitals Property

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

Description

Gets or sets values specifying wheather the lowercase letters of the selected text 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).

Syntax

public Capitals Capitals { get; set; }

Members

ValueDescription
NoneThere are no text effects with capital letters.
CapitalsAll lowercase letters are displayed with capital letters.
PetiteCapitalsAll lowercase letters are displayed with capital letters which have the size of the lowercase 'x'.
SmallCapitalsAll lowercase letters are displayed with capital letters which have the size of the lowercase 'x' + 10%.

Examples

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

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

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

Remarks

The property's default value is Capitals.None.

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