# DocumentLink Constructor

> Initializes a new instance of the DocumentLink class.

- **Product:** TX Text Control .NET for WPF
- **Section:** Reference
- **Kind:** Constructor
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.WPF.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 WPF > Reference > TXTextControl > DocumentLink Constructor
- **481 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/documentlink/constructor/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/documentlink/constructor/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/documentlink/constructor/llms-full.txt

---

### Description

Initializes a new instance of the DocumentLink class.

### Syntax

```csharp
public DocumentLink(string text, DocumentTarget documentTarget);
```

```vbnet
Public Sub New(text As String, documentTarget As DocumentTarget)
```

### Parameters

| Parameter | Description |
|---|---|
| text | Specifies the visible text of the link. |
| documentTarget | Specifies an object of the type DocumentTarget specifying to where the link points. |

### Examples

The following example creates an internal link to the customer-details destination.

```csharp
DocumentTarget target = new("CustomerDetails");
textControl.DocumentTargets.Add(target);
DocumentLink documentLink = new("View customer details", target);
textControl.DocumentLinks.Add(documentLink);
```

```vbnet
Dim target As New DocumentTarget("CustomerDetails")
textControl.DocumentTargets.Add(target)
Dim documentLink As New DocumentLink("View customer details", target)
textControl.DocumentLinks.Add(documentLink)
```

---

## Nearby

- **Previous:** [DocumentLink.AutoGenerationType Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/documentlink/autogenerationtype-property/llms-full.txt)
- **Next:** [DocumentLink.DescriptiveText Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/documentlink/descriptivetext-property/llms-full.txt)
