# 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 Windows Forms
- **Section:** Reference
- **Kind:** Property
- **Introduced:** 23.0
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.WinForms.SDK` (assembly `TXTextControl.Windows.Forms.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.Windows.Forms.dll` from the setup
- **Path:** TX Text Control .NET for Windows Forms > Reference > TXTextControl > TextControl.SubTextParts Property
- **360 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/subtextparts-property/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/subtextparts-property/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/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-winforms/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-winforms/reference/txtextcontrol/textcontrol/subtextpartleft-event/llms-full.txt)
- **Next:** [TextControl.TabDialog Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/tabdialog-method/llms-full.txt)
