SelectedIndex Property
- Namespace
TXTextControl
- Package
TXTextControl.asTextControl. WPF. SDK TXTextControl.from the private NuGet feed or Text Control Offline Packagesdll
Description
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.
Syntax
public int SelectedIndex { get; set; }Public Property SelectedIndex As IntegerExamples
The following example adds a country selector to a fillable form by using SelectionFormField.SelectedIndex.
SelectionFormField selectionFormField = new(new[] { "Germany", "United Kingdom", "United States" }, 0) { Name = "Country" };
textControl.FormFields.Add(selectionFormField);
selectionFormField.SelectedIndex = 1;
Console.WriteLine($"Selected Index used by Selection Form Field: {selectionFormField.SelectedIndex}");Dim selectionFormField As New SelectionFormField(New String() { "Germany", "United Kingdom", "United States" }, 0) With { .Name = "Country" }
textControl.FormFields.Add(selectionFormField)
selectionFormField.SelectedIndex = 1
Console.WriteLine($"Selected Index used by Selection Form Field: {selectionFormField.SelectedIndex}")