ListBoxBase

Inherits from InputControl.

Properties

AutoHeight: integer = 0

Determines auto sizing for the ListBox.

If value is:

  • null – The normal Height property is used.
  • 0 – The height will be automatically adjusted to the number of items in the ListBox .
  • 1 – The ListBox will be collapsed and rendered as a dropdown list.
  • >1 – The ListBox height will be set to the specified number of items.

InterpretItems: boolean = true

ListBox is designed to be a simple ListBox of text, although it support some extended functionality. Normally this would make ListBox better implemented as a layout, however the added complexity especially in the IWML representation simply is not worth it.

Thus a practical compromise was made to allow extended behaviour via a markup that is specific to ListBox.

When InterpretItems = false, the strings are added to the ListBox unchanged.

When InterpretItems = true, the first characters of each line are used to provide extended information about the line. When the first character on a line are:

  • ! – The line will be disabled.
  • * – The line will be a group heading for grouping lines after it. Groups can only be one level deep and cannot be nested. If * is on a line by itself, it will close the current group and the next line will be at the root level and not part of a group.
  • *! – Disabled group. This disables all sub items of a group.
  • Other – The line will be added exactly as provided.

If | exists inside a non group line, the line will be split by value|text and value can be used with the Value property. If more than one | exists, latter parts will be discarded. This is intentional and leaves room for future expansion.

Items: String[]

Contains a list of strings to display in the control. No markdown is permitted and all items must be plain text.

Items are parsed into ._InternalItemsAndGroups and ._InternalItems. If you wish to modify them directly in code without having them overwritten, set the value of Items to null.

See also the InterpretItems property.

Events

SelectionChanged

Occurs when selection changes. Based on the DOM change event for the select element.