# TextField Constructor

> Creates a new instance of the TextField 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 > TextField Constructor
- **534 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textfield/constructor/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textfield/constructor/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textfield/constructor/llms-full.txt

---

### Description

Creates a new instance of the TextField class.

### Syntax

#### TextField()

Creates an empty TextField object.

```csharp
public TextField();
```

```vbnet
Public Sub New()
```

#### TextField(string)

Creates a TextField object with the specified visible text.

```csharp
public TextField(string text);
```

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

| Parameter | Description |
|---|---|
| text | Specifies the visible text of the text field. |

### Examples

The following example inserts a Word-compatible text field into a template.

```csharp
TextField textField = new ApplicationField(ApplicationFieldFormat.MSWord, "MERGEFIELD", "Customer name", new[] { "CustomerName" });
textControl.TextFields.Add(textField);
```

```vbnet
Dim textField As TextField = New ApplicationField(ApplicationFieldFormat.MSWord, "MERGEFIELD", "Customer name", New String() { "CustomerName" })
textControl.TextFields.Add(textField)
```

---

## Nearby

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