# SubTextPart.GetChildren Method

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

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 29.0
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.Core.SDK` (assembly `TXTextControl.Core.dll`, from the private NuGet feed or Text Control Offline Packages)
- **Package:** `TXTextControl.TextControl.ASP.SDK` (assembly `TXTextControl.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.dll` from the setup
- **Path:** TX Text Control .NET Server > Reference > TXTextControl > SubTextPart.GetChildren Method
- **589 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/subtextpart/getchildren-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/subtextpart/getchildren-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/subtextpart/getchildren-method/llms-full.txt

---

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

```csharp
public SubTextPart[] GetChildren();
```

```vbnet
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`.

```csharp
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);
}
```

```vbnet
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
```

---

## Nearby

- **Previous:** [SubTextPart.Data Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/subtextpart/data-property/llms-full.txt)
- **Next:** [SubTextPart.GetTextFields Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/subtextpart/gettextfields-method/llms-full.txt)
