TX Text Control .NET for Windows Forms

IsElseInstructionEnabled Property

Property|Introduced in 28.0
Namespace
TXTextControl
Package
TXTextControl.TextControl.WinForms.SDK as TXTextControl.dll from the private NuGet feed or Text Control Offline Packages

Description

Gets or sets a value indicating whether this Instruction allows to execute else instructions. If this property is set to true, the else instruction value is applied by the specified action when the defined requirements of the ConditionalInstruction.Conditions array are not fulfilled. The default value is false, if no else instruction value was set by the instruction constructor. Otherwise true.

Syntax

public bool IsElseInstructionEnabled { get; set; }

Examples

The following example builds a rule around an approval check box in a fillable form by using Instruction.IsElseInstructionEnabled.

CheckFormField approvalField = new(false) { Name = "Approved" };
textControl.FormFields.Add(approvalField);
Instruction instruction = new(approvalField, Instruction.InstructionTypes.IsEnabled, true);

instruction.IsElseInstructionEnabled = true;
if (instruction.IsElseInstructionEnabled)
{
    Console.WriteLine("Instruction: Is Else Instruction Enabled is enabled.");
}