SelectionFormField Class
- Namespace
TXTextControl
- Package
TXTextControl.from the private NuGet feed or Text Control Offline PackagesTextControl. WPF. SDK
- Assembly
TXTextControl.dll
- Install
dotnet add package TXTextControl..NET 8 and later. For .NET Framework, referenceTextControl. WPF. SDK TXTextControl.from the setup.dll
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 : FormFieldPublic Class SelectionFormField
Inherits FormFieldExamples
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);Dim selectionFormField As New SelectionFormField(New String() { "Germany", "United Kingdom", "United States" }, 0) With { .Name = "Country" }
textControl.FormFields.Add(selectionFormField)Members
Constructors
| Constructor | Description |
|---|---|
| SelectionFormField | Initializes a new instance of the SelectionFormField class. |
Properties
| Property | Description |
|---|---|
| DescriptiveText | Gets 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.) |
| EmptyWidth | Gets or sets the horizontal extension, in twips, of the SelectionFormField, when there is no selected item. |
| Enabled | Gets 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.) |
| IsDropDownArrowVisible | Gets or sets a value indicating wheather a dropdown arrow is shown so that the user can select an item. |
| Items | Gets or sets a list of items for the SelectionFormField. An item must not be an empty string. |
| SelectedIndex | Gets 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
| Method | Description |
|---|---|
| FormFieldDialog | Opens a dialog box to alter the formatting attributes of the form field. (Inherited from FormField.) |