TX Text Control .NET for Windows Forms

ConditionalInstructionDialog Method

Method|Introduced in 28.0
Namespace
TXTextControl
Package
TXTextControl.TextControl.WinForms.SDK as TXTextControl.Windows.Forms.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 System.Windows.Forms.DialogResult 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 System.Windows.Forms.DialogResult 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
DialogResult.OKThe dialog has been left with the OK button and the corresponding Conditional Instruction was created or edited.
DialogResult.CancelThe dialog has been left with the Cancel button.
DialogResult.AbortThe 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. In these cases the method returns DialogResult.Abort.