# TextControl.SubTextParts Property

> Gets a collection of all subtextparts contained in the text part with the input focus. This can be the main text, a text frame or a header or footer. The property's value is an object of the type SubTextPartCollection.

- **Product:** TX Text Control .NET for WPF
- **Section:** Reference
- **Kind:** Property
- **Introduced:** 23.0
- **Namespace:** `TXTextControl.WPF`
- **Package:** `TXTextControl.TextControl.WPF.SDK` (assembly `TXTextControl.WPF.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.WPF.dll` from the setup
- **Path:** TX Text Control .NET for WPF > Reference > TXTextControl.WPF > TextControl.SubTextParts Property
- **359 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/subtextparts-property/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/subtextparts-property/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/subtextparts-property/llms-full.txt

---

### Description

Gets a collection of all subtextparts contained in the text part with the input focus. This can be the main text, a text frame or a header or footer. The property's value is an object of the type [SubTextPartCollection](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/subtextpartcollection/llms-full.txt).

### Syntax

```csharp
public SubTextPartCollection SubTextParts { get; }
```

```vbnet
Public ReadOnly Property SubTextParts As SubTextPartCollection
```

### Examples

The following example iterates through the sub text parts collection and processes each sub text part.

```csharp
foreach (SubTextPart subTextPart in textControl.SubTextParts)
{
    subTextPart.Name = "CustomerName";
}
```

```vbnet
For Each subTextPart As SubTextPart In textControl.SubTextParts
    subTextPart.Name = "CustomerName"
Next
```

### Limitations

Runtime only.

Read only.

---

## Nearby

- **Previous:** [TextControl.SubTextPartLeft Event](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/subtextpartleft-event/llms-full.txt)
- **Next:** [TextControl.TabDialog Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/tabdialog-method/llms-full.txt)
