# IfField Constructor

> Initializes a new instance of the IfField class.

- **Product:** TX Text Control .NET for Windows Forms
- **Section:** Reference
- **Kind:** Constructor
- **Introduced:** 15.0
- **Namespace:** `TXTextControl.DocumentServer.Fields`
- **Package:** `TXTextControl.TextControl.WinForms.SDK` (assembly `TXDocumentServer.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXDocumentServer.dll` from the setup
- **Path:** TX Text Control .NET for Windows Forms > Reference > TXTextControl.DocumentServer.Fields > IfField Constructor
- **481 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-fields/iffield/constructor/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-fields/iffield/constructor/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-fields/iffield/constructor/llms-full.txt

---

### Description

Initializes a new instance of the IfField class.

### Syntax

#### IfField()

Initializes a complete new instance of the IfField class without a connection to an existing ApplicationField.

```csharp
public IfField();
```

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

#### IfField(ApplicationField)

Initializes a new instance of the IfField class with a connection to an existing ApplicationField.

```csharp
public IfField(ApplicationField appField);
```

```vbnet
Public Sub New(appField As ApplicationField)
```

| Parameter | Description |
|---|---|
| appField | Specifies the ApplicationField to be adapted. |

### Examples

The following example creates an If Field instance and configures its text setting for a document workflow.

```csharp
TXTextControl.DocumentServer.Fields.IfField ifField = new();
ifField.Text = "Quarterly results";
```

```vbnet
Dim ifField As New TXTextControl.DocumentServer.Fields.IfField()
ifField.Text = "Quarterly results"
```

---

## Nearby

- **Previous:** [IfField Class](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-fields/iffield/llms-full.txt)
- **Next:** [IfField.DataSourceCulture Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-fields/iffield/datasourceculture-property/llms-full.txt)
