TX Text Control .NET for WPF

ListFormat Class

Class
Namespace
TXTextControl
Package
TXTextControl.TextControl.WPF.SDK from the private NuGet feed or Text Control Offline Packages
Assembly
TXTextControl.dll
Install
dotnet add package TXTextControl.TextControl.WPF.SDK .NET 8 and later. For .NET Framework, reference TXTextControl.dll from the setup.

Description

An instance of the ListFormat class represents the formatting attributes of a bulleted or numbered list.

Syntax

public class ListFormat

Examples

The following example shows how to create a new ListFormat and how to apply it at the current input position.

TXTextControl.ListFormat lf = new TXTextControl.ListFormat();
lf.Type = TXTextControl.ListType.Numbered;
lf.FirstNumber = 5;

textControl1.Selection.ListFormat = lf;

The following example creates a numbered-list format and applies it to three selected action items.

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

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

Members

Constructors

ConstructorDescription
ListFormatCreates a new instance of the ListFormat class.

Properties

PropertyDescription
BulletCharacterGets or sets the symbol character for a bulleted list. It must be a value from the Windows Symbol character set.
BulletSizeGets or sets the size of the symbol character for a bulleted list. If this property is 0, the size of the font for the list text is used.
CharAfterNumberObsolete. Gets or sets a character that is displayed behind the number in a numbered list. If this property is zero, no additional character is diplayed behind the number character. This property is obsolete and only available for compatibility. A new application should use the TextAfterNumber property.
CharBeforeNumberObsolete. Gets or sets a character that is displayed in front of the number in a numbered list. If this property is zero, no additional character is diplayed in front of the number character. This property is obsolete and only available for compatibility. A new application should use the TextBeforeNumber property.
FirstNumberGets or sets the starting number for a numbered list.
FontNameGets or sets the font used for the bullet character. When a new bullet character is set without specifying a font, the Windows Symbol font is assumed.
FormatCharacterGets or sets the formatting character for a bulleted or numbered list.
HangingIndentGets or sets the hanging indent of a numbered list.
LeftIndentGets or sets the left indent for a numbered list.
LevelGets or sets the level for a bulleted or numbered list.
NumberFormatGets or sets the number format for a numbered list. The property's value is a member of the NumberFormat enumeration.
RestartNumberingGets or sets a value determining whether a new numbered list begins.
TextAfterNumberGets or sets the text that is displayed behind the number in a numbered list. If this property is an empty string, no additional text is diplayed behind the number. This property replaces the CharAfterNumber property of this class.
TextBeforeNumberGets or sets the text that is displayed in front of the number in a numbered list. If this property is an empty string, no additional text is diplayed in front of the number. This property replaces the CharBeforeNumber property of this class.
TypeGets or sets the type of the list, bulleted, numbered or none. The property's value is one of the values of the ListType enumeration.

Fields

FieldDescription
MaxLevelRepresents the maximum of levels for bulleted and numbered lists. The value of this constant is 10.
MaxTextRepresents the maximum number of charcters for the additinal text in front and behind the number of a numbered list. The value of this constant is 20.

Enumerations

EnumerationDescription
AttributeDetermines a certain list format attribute. This enumeration is used with the Selection.IsCommonValueSelected method.