# HypertextLinkCollection Class

> An instance of the HypertextLinkCollection class contains all hypertext links in a Text Control document represented through objects of the type HypertextLink. An instance of this class can be obtained with the TextControl.HypertextLinks property. The HypertextLinkCollection class implements the IEnumerable and the ICollection interfaces. For more information see the technical article Text Fields and Hypertext Links.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Class
- **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
- **Inherits:** `TXTextControl.TextFieldCollectionBase`
- **Implements:** `System.Collections.ICollection`, `System.Collections.IEnumerable`
- **Path:** TX Text Control .NET Server > Reference > TXTextControl > HypertextLinkCollection Class
- **1359 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/hypertextlinkcollection/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/hypertextlinkcollection/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/hypertextlinkcollection/llms-full.txt

---

### Description

An instance of the HypertextLinkCollection class contains all hypertext links in a Text Control document represented through objects of the type [HypertextLink](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/hypertextlink/llms-full.txt). An instance of this class can be obtained with the [TextControl.HypertextLinks](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/hypertextlinks-property/llms-full.txt) property. The HypertextLinkCollection class implements the IEnumerable and the ICollection interfaces. For more information see the technical article Text Fields and Hypertext Links.

### Syntax

```csharp
public sealed class HypertextLinkCollection : TextFieldCollectionBase
```

```vbnet
Public NotInheritable Class HypertextLinkCollection
    Inherits TextFieldCollectionBase
```

### Examples

The following example works with hypertext links in the current document.

```csharp
textControl.Text = "Customer: Contoso Ltd.";
textControl.Select(10, 12);
HypertextLinkCollection hypertextLinkCollection = textControl.HypertextLinks;
hypertextLinkCollection.Add(new HypertextLink("Documentation", "https://docs.textcontrol.com/") { ID = 100 });
```

```vbnet
textControl.Text = "Customer: Contoso Ltd."
textControl.Select(10, 12)
Dim hypertextLinkCollection As HypertextLinkCollection = textControl.HypertextLinks
hypertextLinkCollection.Add(New HypertextLink("Documentation", "https://docs.textcontrol.com/") With { .ID = 100 })
```

---

## In This Section

- [HypertextLinkCollection.Add Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/hypertextlinkcollection/add-method/llms-full.txt): Inserts a new hypertext link at the current input position.
- [HypertextLinkCollection.Clear Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/hypertextlinkcollection/clear-method/llms-full.txt): Removes all hypertext links from a Text Control document.
- [HypertextLinkCollection.CopyTo Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/hypertextlinkcollection/copyto-method/llms-full.txt): Copies the elements of the collection to an array, starting at a particular index.
- [HypertextLinkCollection.GetItem Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/hypertextlinkcollection/getitem-method/llms-full.txt): Gets a particular hypertext link from the collection.
- [HypertextLinkCollection.Item Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/hypertextlinkcollection/item-property/llms-full.txt): Gets the field with the specified number from the collection. The number must be between 1 and Count. In C# this property is the indexer for the HypertextLinkCollection class.
- [HypertextLinkCollection.Remove Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/hypertextlinkcollection/remove-method/llms-full.txt): Removes a hypertext link from a Text Control document.

---

## Nearby

- **Previous:** [HypertextLink.Target Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/hypertextlink/target-property/llms-full.txt)
- **Next:** [HypertextLinkCollection.Add Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/hypertextlinkcollection/add-method/llms-full.txt)
