# SubTextPart.ID Property

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

- **Product:** TX Text Control .NET for Windows Forms
- **Section:** Reference
- **Kind:** Property
- **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.ID Property
- **518 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/subtextpart/id-property/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/subtextpart/id-property/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/subtextpart/id-property/llms-full.txt

---

### Description

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.

### Syntax

```csharp
public int ID { get; set; }
```

```vbnet
Public Property ID As Integer
```

### Examples

The following example marks the selected customer name as a named document region by using `SubTextPart.ID`.

```csharp
textControl.Text = "Customer: Contoso Ltd.";
textControl.Select(10, 12);
SubTextPart subTextPart = new("CustomerName", 10);
textControl.SubTextParts.Add(subTextPart);

subTextPart.ID = 100;
Console.WriteLine($"ID used by Sub Text Part: {subTextPart.ID}");
```

```vbnet
textControl.Text = "Customer: Contoso Ltd."
textControl.Select(10, 12)
Dim subTextPart As New SubTextPart("CustomerName", 10)
textControl.SubTextParts.Add(subTextPart)

subTextPart.ID = 100
Console.WriteLine($"ID used by Sub Text Part: {subTextPart.ID}")
```

---

## Nearby

- **Previous:** [SubTextPart.HighlightMode Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/subtextpart/highlightmode-property/llms-full.txt)
- **Next:** [SubTextPart.Length Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/subtextpart/length-property/llms-full.txt)
