# SubTextPart Class

> A SubTextPart object represents a user-defined part of a TX Text Control document. A TX Text Control document consists of the main text, and additionally other pieces of text such as text frames and headers or footers, called textparts. A programmer can define further parts called subtextparts to perform operations on smaller pieces of text. Each of the main textparts has a SubTextPartCollection which can be used to add and remove subtextparts or to save the subtextpart's text.

- **Product:** TX Text Control .NET for Windows Forms
- **Section:** Reference
- **Kind:** Class
- **Introduced:** 23.0
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.WinForms.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 for Windows Forms > Reference > TXTextControl > SubTextPart Class
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/subtextpart/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/subtextpart/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/subtextpart/llms-full.txt

---

## On This Page

- [Description](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/subtextpart/#description)
- [Syntax](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/subtextpart/#syntax)
- [Examples](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/subtextpart/#examples)
- [Members](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/subtextpart/#members)

---

## In This Section

- [SubTextPart Constructor](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/subtextpart/constructor/llms.txt): Initializes a new instance of the SubTextPart class.
- [SubTextPart.Data Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/subtextpart/data-property/llms.txt): Gets or sets additional data of the subtextpart. An empty string indicates that the subtextpart has no data.
- [SubTextPart.GetChildren Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/subtextpart/getchildren-method/llms.txt): 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.
- [SubTextPart.GetTextFields Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/subtextpart/gettextfields-method/llms.txt): Returns an array of TextField objects which are completely contained in this SubTextPart. The objects' type depend on the fieldType parameter.
- [SubTextPart.HighlightColor Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/subtextpart/highlightcolor-property/llms.txt): Gets or sets the highlight color for the subtextpart. A subtextpart is highlighted, if it contains the current text input position. The color's alpha value must be less than 255 (opaque) so that the textpart's text remains visible. The default value is red with an alpha value of 60.
- [SubTextPart.HighlightMode Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/subtextpart/highlightmode-property/llms.txt): Gets or sets a value indicating when the subtextpart is highlighted.
- [SubTextPart.ID Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/subtextpart/id-property/llms.txt): Gets or sets the subtextpart's identifier. It must be a one-based value. A value of zero indicates that the subtextpart has no identifier.
- [SubTextPart.Length Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/subtextpart/length-property/llms.txt): Gets the number of characters which belong to the subtextpart.
- [SubTextPart.Name Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/subtextpart/name-property/llms.txt): Gets or sets the name of the subtextpart. An empty string indicates that the subtextpart has no name.
- [SubTextPart.NestedLevel Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/subtextpart/nestedlevel-property/llms.txt): Gets the subtextpart's nested level. The top level is 1.
- [SubTextPart.Number Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/subtextpart/number-property/llms.txt): Gets the subtextpart's number. The first subtextpart has the number 1. The number is defined through the textflow. A textpart with a smaller start position has a smaller number. When an outer subtextpart has the same start position than one of its nested textparts the outer textpart has a smaller number.
- [SubTextPart.OuterMostSubTextPart Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/subtextpart/outermostsubtextpart-property/llms.txt): Gets a subtextpart's outermost subtextpart. This is a top-level subtextpart with a nested level of 1. The property's value is an object of the type SubTextPart or null if this subtextpart is already a top-level subtextpart.
- [SubTextPart.OuterSubTextPart Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/subtextpart/outersubtextpart-property/llms.txt): Gets a subtextpart's outer subtextpart. The property's value is an object of the type SubTextPart or null if this subtextpart is a top-level subtextpart.
- [SubTextPart.Save Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/subtextpart/save-method/llms.txt): Saves the subtextpart's text with the specified format.
- [SubTextPart.ScrollTo Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/subtextpart/scrollto-method/llms.txt): Sets the current input position to the beginning of a subtextpart and scrolls it into the visible part of the document.
- [SubTextPart.Start Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/subtextpart/start-property/llms.txt): Gets the index (one-based) of the first character which belongs to the subtextpart.
- [SubTextPart.Text Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/subtextpart/text-property/llms.txt): Gets the subtextpart's text.

---

## Nearby

- **Previous:** [StringStreamType Enumeration](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/stringstreamtype/enumeration/llms.txt)
- **Next:** [SubTextPart Constructor](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/subtextpart/constructor/llms.txt)
