# ConditionalInstruction Constructor

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

---

### Description

Initializes a new instance of the ConditionalInstruction class.

### Syntax

#### ConditionalInstruction()

Initializes a new instance of the ConditionalInstruction class without any of the required values.

```csharp
public ConditionalInstruction();
```

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

#### ConditionalInstruction(string, Condition\[\], Instruction\[\])

Initializes a new instance of the ConditionalInstruction class with all values that are necessary to provide a valid conditional instruction.

```csharp
public ConditionalInstruction(string name, Condition[] conditions, Instruction[] instructions);
```

```vbnet
Public Sub New(name As String, conditions As Condition(), instructions As Instruction())
```

| Parameter | Description |
|---|---|
| name | Specifies the [name](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/conditionalinstruction/name-property/llms-full.txt) of the conditional instruction. If the value is null or an empty string, a `System.ArgumentException` is thrown. |
| conditions | Specifies the [conditions](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/conditionalinstruction/conditions-property/llms-full.txt) of the conditional instruction. If the value is null, an empty array of [conditions](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/condition/llms-full.txt) or at least one of the array elements is null, a `System.ArgumentException` is thrown. |
| instructions | Specifies the [instructions](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/conditionalinstruction/instructions-property/llms-full.txt) of the conditional instruction. If the value is null, an empty array of [instructions](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/instruction/llms-full.txt), at least one of the array elements is null or the array contains an `Instruction` element, where its [InstructionType](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/instruction/instructiontype-property/llms-full.txt) property value is already set by another `Instruction` array element for the same [FormField](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/formfield/llms-full.txt), a `System.ArgumentException` is thrown. |

### Examples

The following example creates a Conditional Instruction instance and configures its are else instructions handled setting for a document workflow.

```csharp
ConditionalInstruction conditionalInstruction = new();
conditionalInstruction.AreElseInstructionsHandled = true;
```

```vbnet
Dim conditionalInstruction As New ConditionalInstruction()
conditionalInstruction.AreElseInstructionsHandled = True
```

---

## Nearby

- **Previous:** [ConditionalInstruction.Conditions Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/conditionalinstruction/conditions-property/llms-full.txt)
- **Next:** [ConditionalInstruction.Copy Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/conditionalinstruction/copy-method/llms-full.txt)
