# TextFieldCollection.Add Method

> Inserts a new standard text field at the current input position.

- **Product:** TX Text Control .NET for Windows Forms
- **Section:** Reference
- **Kind:** Method
- **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 > TextFieldCollection.Add Method
- **579 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textfieldcollection/add-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textfieldcollection/add-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textfieldcollection/add-method/llms-full.txt

---

### Description

Inserts a new standard text field at the current input position.

### Syntax

```csharp
public bool Add(TextField textField);
```

```vbnet
Public Function Add(textField As TextField) As Boolean
```

### Parameters

| Parameter | Description |
|---|---|
| textField | Specifies the text field to add. |

### Return Value

The return value is true, if the text field could be added. Otherwise it is false.

### Examples

The following example works with text fields in the current document by using `TextFieldCollection.Add`.

```csharp
textControl.Text = "Customer: Contoso Ltd.";
textControl.Select(10, 12);
TextFieldCollection textFieldCollection = textControl.TextFields;

if (!textFieldCollection.Add(new TextField()))
{
    throw new InvalidOperationException("The item could not be inserted.");
}
```

```vbnet
textControl.Text = "Customer: Contoso Ltd."
textControl.Select(10, 12)
Dim textFieldCollection As TextFieldCollection = textControl.TextFields

If Not textFieldCollection.Add(New TextField()) Then
    Throw New InvalidOperationException("The item could not be inserted.")
End If
```

---

## Nearby

- **Previous:** [TextFieldCollection Class](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textfieldcollection/llms-full.txt)
- **Next:** [TextFieldCollection.Clear Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textfieldcollection/clear-method/llms-full.txt)
