TX Text Control .NET Server

SelectionFormField Class

Class|Introduced in 28.0
Namespace
TXTextControl
Package
TXTextControl.TextControl.Core.SDK from the private NuGet feed or Text Control Offline Packages
Assembly
TXTextControl.Core.dll
Install
dotnet add package TXTextControl.TextControl.Core.SDK .NET 8 and later. For .NET Framework, reference TXTextControl.dll from the setup.
Also in
TXTextControl.TextControl.ASP.SDK as TXTextControl.dll
Inherits
  1. TextField
  2. FormField
  3. SelectionFormField

Description

An object of the SelectionFormField class represents a combobox or a drop-down list on a form. It can be initially empty and it can have a horizontal extension, when it is empty. Depending on the Editable property the SelectionFormField either is a combobox or a drop-down list.

Syntax

public class SelectionFormField : FormField

Examples

The following example adds a country selector to a fillable form.

SelectionFormField selectionFormField = new(new[] { "Germany", "United Kingdom", "United States" }, 0) { Name = "Country" };
textControl.FormFields.Add(selectionFormField);

Members

Constructors

ConstructorDescription
SelectionFormFieldInitializes a new instance of the SelectionFormField class.

Properties

PropertyDescription
DescriptiveTextGets or sets a descriptive text for a form field. An empty string indicates that the form field has no such text. An empty string can also be used to delete a previously set text. (Inherited from FormField.)
EmptyWidthGets or sets the horizontal extension, in twips, of the SelectionFormField, when there is no selected item.
EnabledGets or set a value indicating whether the form field is enabled. This property has only an effect, when the when the TextControl.EditMode is set to ReadAndSelect and the DocumentPermissions.AllowEditingFormFields property has been set to true. In this case a Formfield can only be edited, when its Enabled property is true. When a FormField is disabled, the TextFieldClicked and TextFieldDoubleClicked of the Formfield are suppressed. The default value of this property is true. (Inherited from FormField.)
IsDropDownArrowVisibleGets or sets a value indicating wheather a dropdown arrow is shown so that the user can select an item.
ItemsGets or sets a list of items for the SelectionFormField. An item must not be an empty string.
SelectedIndexGets or sets the index of the selected item of the SelectionFormField. If the property value is -1, no item is selected and the currently selected item is deselected.

Methods

MethodDescription
FormFieldDialogOpens a dialog box to alter the formatting attributes of the form field. (Inherited from FormField.)

Further Reading