# TextFormField Constructor

> Initializes a new instance of the TextFormField class.

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

---

### Description

Initializes a new instance of the TextFormField class.

### Syntax

```csharp
public TextFormField(int emptyWidth);
```

```vbnet
Public Sub New(emptyWidth As Integer)
```

### Parameters

| Parameter | Description |
|---|---|
| emptyWidth | Specifies the horizontal extension, in twips, of the form field, when it is empty. When this parameter is set to 0, a default value is used. |

### Examples

The following example adds a customer-name input field to a form.

```csharp
TextFormField textFormField = new(20) { Name = "CustomerName" };
textControl.FormFields.Add(textFormField);
```

```vbnet
Dim textFormField As New TextFormField(20) With { .Name = "CustomerName" }
textControl.FormFields.Add(textFormField)
```

---

## Nearby

- **Previous:** [TextFormField Class](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textformfield/llms-full.txt)
- **Next:** [TextFormField.EmptyWidth Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textformfield/emptywidth-property/llms-full.txt)
