TX Text Control .NET for WPF

StructureLevel Property

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

Description

Gets or sets the structure level of a paragraph in the document. The level can be between 0 and 10. A level of 0 indicates that the paragraph belongs to the body of the document.

Syntax

public int StructureLevel { get; set; }

Examples

The following example applies paragraph layout to selected report text by using ParagraphFormat.StructureLevel.

textControl.Text = "First item\nSecond item\nThird item";
textControl.Select(0, textControl.Text.Length);
ParagraphFormat paragraphFormat = textControl.Selection.ParagraphFormat;

paragraphFormat.StructureLevel = 10;
Console.WriteLine($"Structure Level used by Paragraph Format: {paragraphFormat.StructureLevel}");

textControl.Selection.ParagraphFormat = paragraphFormat;

Remarks

The property's default value is 0.

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