# SubTextPartCollection.Item Property

> Gets the subtextpart with the specified number from the collection. The number must be between 1 and Count. In C# this property is the indexer for the SubTextPartCollection class.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Property
- **Introduced:** 23.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 > SubTextPartCollection.Item Property
- **657 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/subtextpartcollection/item-property/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/subtextpartcollection/item-property/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/subtextpartcollection/item-property/llms-full.txt

---

### Description

Gets the subtextpart with the specified number from the collection. The number must be between 1 and Count. In C# this property is the indexer for the SubTextPartCollection class.

### Syntax

```csharp
public SubTextPart this[int number] { get; }
```

```vbnet
Default Public ReadOnly Property Item(number As Integer) As SubTextPart
```

### Examples

The following example updates the metadata stored with the first named region.

```csharp
textControl.Text = "Customer: Contoso Ltd.";
textControl.Select(10, 12);
SubTextPartCollection parts = textControl.SubTextParts;
SubTextPart customer = new("CustomerName", 10) { Data = @"{""category"":""customer""}" };
parts.Add(customer);
if (parts.Count > 0)
{
    parts[1].Data = @"{""reviewed"":true}";
}
```

```vbnet
textControl.Text = "Customer: Contoso Ltd."
textControl.Select(10, 12)
Dim parts As SubTextPartCollection = textControl.SubTextParts
Dim customer As New SubTextPart("CustomerName", 10) With { .Data = "{""category"":""customer""}" }
parts.Add(customer)
If parts.Count > 0 Then
    parts.Item(1).Data = "{""reviewed"":true}"
End If
```

### Limitations

Read only.

---

## Nearby

- **Previous:** [SubTextPartCollection.IsSynchronized Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/subtextpartcollection/issynchronized-property/llms-full.txt)
- **Next:** [SubTextPartCollection.Remove Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/subtextpartcollection/remove-method/llms-full.txt)
