SelectionFormField Constructor
- Namespace
TXTextControl
- Package
TXTextControl.asTextControl. WPF. SDK TXTextControl.from the private NuGet feed or Text Control Offline Packagesdll
Description
Initializes a new instance of the SelectionFormField class.
Syntax
SelectionFormField(int)
Initializes a new instance of an empty SelectionFormField. It has no items and no text.
public SelectionFormField(int emptyWidth);Public Sub New(emptyWidth As Integer)| Parameter | Description |
|---|---|
| emptyWidth | Specifies the horizontal extension, in twips, of the SelectionFormField, when there is no selected item. When this parameter is set to 0, a default value is used. |
SelectionFormField(string[], int)
Initializes a new instance of a SelectionFormField with the specified items and the index of the selected item.
public SelectionFormField(string[] items, int selectedIndex);Public Sub New(items As String(), selectedIndex As Integer)| Parameter | Description |
|---|---|
| items | Specifies a list of items for the SelectionFormField. |
| selectedIndex | Specifies the zero-based index of the selected item. When this parameter is -1, no item is selected. |
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);Dim selectionFormField As New SelectionFormField(New String() { "Germany", "United Kingdom", "United States" }, 0) With { .Name = "Country" }
textControl.FormFields.Add(selectionFormField)