TX Text Control .NET for WPF

ConditionalInstructionDialog Method

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

Description

Opens a dialog box to create or edit a Conditional Instruction.

Syntax

ConditionalInstructionDialog()

Opens a dialog box to create a new Conditional Instruction.

public bool? ConditionalInstructionDialog();

ConditionalInstructionDialog(string)

Opens a dialog box to edit a specific Conditional Instruction. If the document does not contain a Conditional Instruction with the specified name, the dialog is opened to create such a Conditional Instruction.

public bool? ConditionalInstructionDialog(string name);
ParameterDescription
name

Specifies the name of the Conditional Instruction to edit or create.

Return Value

The return value can be one of the following values:

ResultMeaning
trueThe dialog has been left with the OK button and the corresponding Conditional Instruction was created or edited.
falseThe dialog has been left with the Cancel button.
nullThe dialog has not been opened.

Examples

The following example opens the conditional instruction dialog for the text control.

var result = textControl.ConditionalInstructionDialog("CustomerName");
Console.WriteLine($"Conditional Instruction Dialog result: {result}");

Limitations

The dialog cannot be opened, if the document does not contain form fields, the TextControl.IsFormFieldValidationEnabled is set to false or the EditMode property is set to EditMode.ReadAndSelect and TextControl.DocumentPermissions.ReadOnly to true. In these cases the method returns null.