GetChildren Method
- Namespace
TXTextControl
- Package
TXTextControl.asTextControl. WinForms. SDK TXTextControl.from the private NuGet feed or Text Control Offline Packagesdll
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();Public Function GetChildren() As SubTextPart()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);
}textControl.Text = "Customer: Contoso Ltd."
textControl.Select(10, 12)
Dim subTextPart As New SubTextPart("CustomerName", 10)
textControl.SubTextParts.Add(subTextPart)
Dim results As SubTextPart() = subTextPart.GetChildren()
For Each subTextPartItem As SubTextPart In results
Console.WriteLine(subTextPartItem)
Next