# DocumentTarget Constructor

> Creates a new instance of the DocumentTarget class.

- **Product:** TX Text Control .NET for Windows Forms
- **Section:** Reference
- **Kind:** Constructor
- **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 > DocumentTarget Constructor
- **598 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/documenttarget/constructor/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/documenttarget/constructor/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/documenttarget/constructor/llms-full.txt

---

### Description

Creates a new instance of the DocumentTarget class.

### Syntax

#### DocumentTarget(string)

Creates a new instance of the DocumentTarget class with the specified target name.

```csharp
public DocumentTarget(string targetName);
```

```vbnet
Public Sub New(targetName As String)
```

| Parameter | Description |
|---|---|
| targetName | Specifies the name of the target. |

#### DocumentTarget(string, int)

Creates a new instance of the DocumentTarget class with the specified target name and position.

```csharp
public DocumentTarget(string targetName, int position);
```

```vbnet
Public Sub New(targetName As String, position As Integer)
```

| Parameter | Description |
|---|---|
| targetName | Specifies the name of the target. |
| position | Specifies the one-based character position where to insert the target. The target's position is at the left edge of this charcter. |

### Examples

The following example creates a named destination for an internal document link.

```csharp
DocumentTarget documentTarget = new("CustomerDetails");
textControl.DocumentTargets.Add(documentTarget);
```

```vbnet
Dim documentTarget As New DocumentTarget("CustomerDetails")
textControl.DocumentTargets.Add(documentTarget)
```

---

## Nearby

- **Previous:** [DocumentTarget.Bounds Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/documenttarget/bounds-property/llms-full.txt)
- **Next:** [DocumentTarget.ContainsInputPosition Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/documenttarget/containsinputposition-property/llms-full.txt)
