TX Text Control .NET for WPF

GetChildren Method

Method|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

Returns an array of SubTextPart objects which are the children of this SubTextPart. The array contains all direct children and all further descendants in the order as they appear in the text.

Syntax

public SubTextPart[] GetChildren();

Return Value

The return value is null if this SubTextPart has no children. Otherwise, it is an array of SubTextPart objects.

Examples

The following example marks the selected customer name as a named document region by using SubTextPart.GetChildren.

textControl.Text = "Customer: Contoso Ltd.";
textControl.Select(10, 12);
SubTextPart subTextPart = new("CustomerName", 10);
textControl.SubTextParts.Add(subTextPart);

SubTextPart[] results = subTextPart.GetChildren();
foreach (SubTextPart subTextPartItem in results)
{
    Console.WriteLine(subTextPartItem);
}