TX Text Control .NET for Windows Forms

NumberFormat 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 number format for a numbered list. The property's value is a member of the NumberFormat enumeration.

Syntax

public NumberFormat NumberFormat { get; set; }

Members

ValueDescription
ArabicNumbersThe list is numbered with Arabic numbers (1, 2, 3...).
LettersThe list is numbered with letters (a, b, c...).
CapitalLettersThe list is numbered with capital letters (A, B, C...).
RomanNumbersThe list is numbered with Roman numbers (I, II, III...).
SmallRomanNumbersThe list is numbered with small Roman numbers (i, ii, iii...).

Examples

The following example applies NumberFormat while converting three selected paragraphs into a usable numbered list.

textControl.Text = "Research\nDraft\nReview";
textControl.Select(0, textControl.Text.Length);

ListFormat listFormat = new()
{
    Type = ListType.Numbered,
    NumberFormat = NumberFormat.Letters
};
textControl.Selection.ListFormat = listFormat;

Remarks

The property's default value is NumberFormat.ArabicNumbers.

The property returns its default value when the text selection contains multiple paragraphs with mixed number formats or when the text selection does not contain a numbered list. The Selection.IsCommonValueSelected method can be used to check for mixed attributes.