# IfField Class

> The IfField class implements the MS Word specific IF field. This field must be used in combination with an ApplicationField that should be modified using this adapter.

- **Product:** TX Text Control .NET for Windows Forms
- **Section:** Reference
- **Kind:** Class
- **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
- **Inherits:** `TXTextControl.DocumentServer.Fields.FieldAdapter` › `TXTextControl.DocumentServer.Fields.MailMergeFieldAdapter`
- **Path:** TX Text Control .NET for Windows Forms > Reference > TXTextControl.DocumentServer.Fields > IfField Class
- **1191 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-fields/iffield/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-fields/iffield/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-fields/iffield/llms-full.txt

---

### Description

The IfField class implements the MS Word specific IF field. This field must be used in combination with an [ApplicationField](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/applicationfield/llms-full.txt) that should be modified using this adapter.

### Syntax

```csharp
public sealed class IfField : MailMergeFieldAdapter
```

```vbnet
Public NotInheritable Class IfField
    Inherits MailMergeFieldAdapter
```

### 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"
```

---

## In This Section

- [IfField Constructor](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-fields/iffield/constructor/llms-full.txt): Initializes a new instance of the IfField class.
- [IfField.DataSourceCulture Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-fields/iffield/datasourceculture-property/llms-full.txt): Specifies the culture which is used for the relational comparison of numerical values. The default value for this property is the current thread culture.
- [IfField.Expression1 Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-fields/iffield/expression1-property/llms-full.txt): Gets and sets the first expression text that should be compared. To use this field in the MailMerge component, this property must be a valid field name.
- [IfField.Expression2 Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-fields/iffield/expression2-property/llms-full.txt): Gets and sets the second expression text that should be compared to Expression1.
- [IfField.FalseText Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-fields/iffield/falsetext-property/llms-full.txt): Gets and sets the text that should be displayed when the comparison is false.
- [IfField.FieldValue Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-fields/iffield/fieldvalue-property/llms-full.txt): Gets or sets the field's value of the field that has been specified in Expression1.
- [IfField.MergeCulture Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-fields/iffield/mergeculture-property/llms-full.txt): Specifies the culture with which numerical and date / time values are formatted when merged into the target document. The default value for this property is the current thread culture.
- [IfField.Operator Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-fields/iffield/operator-property/llms-full.txt): Gets and sets the operator of the field.
- [IfField.Text Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-fields/iffield/text-property/llms-full.txt): Gets and sets the displayed text of the field.
- [IfField.TrueText Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-fields/iffield/truetext-property/llms-full.txt): Gets and sets the text that should be displayed when the comparison is true.

---

## Nearby

- **Previous:** [FormText.Type Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-fields/formtext/type-property/llms-full.txt)
- **Next:** [IfField Constructor](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-fields/iffield/constructor/llms-full.txt)
