ListBox

The ListBox control represents a list of items from which users can select one or more entries.

Properties

  • AllowMultiSelect: A boolean value representing whether or not users can select multiple items. If this is true, the GetSelection method will return an array rather than a single item.
  • Editor: Provides read-only access to the underlying editor control this class manages.
  • Enabled: A boolean value representing whether or not the control is enabled. Disable controls still display on the form, but do not react to any user actions.
  • FieldName: A string representing the name of the field. This can be used for retrieving the control.
  • Focused: A boolean value representing whether or not this field currently has input focus. Setting this value to true will focus the control.
  • Label: A string representing the label that should be displayed beside the field on the form.
  • LabelVisible: A boolean value representing whether or not the label should be displayed.
  • TypeName: A string representing the full name of the control type.

Methods

  • Focus(): This method causes input focus to be given to the control. Calling this function behaves the same as setting the control's Focused value to true.
  • AddItem(string value): Adds a string to the list.

    DirectionNameDescription
    inputvalueThe value to be added to the list.
  • GetSelection(): Retrieves the currently selected item or items from the list box. If AllowMultiSelect is set to true, the return value will be an array containing all of the selected items (even if there is only one selected item). Otherwise, only the single selected item will be returned.

    DirectionNameDescription
    outputobjectEither a string representing the selected item,or, if AllowMultiSelect is set to true, an array containing all of the selected items.