The ValueList control provides a list style selector of named values. It is particularly useful for selecting bit-wise flag values. The selected value can be set by the user or by a connected device. The ValueList control can send a message to a connected device whenever the selection changes and can be updated by commands sent from your Arduino sketch.
Use the collection editor on the NamedValues
property to set the values in the list. Each value is an unsigned, 32-bit number.
Property | Access | Type | Method | Description |
---|---|---|---|---|
NamedValues | Design-only | Collection | — | The collection of named values that the user can select from |
DefaultSelection | Design-only | Integer | — | Index of the item that should be selected initially |
SelectionMode | Design-only | bool | — | Controls whether the user can select 1, many or no items from the list. |
IntegralHeight | Design-only | bool | — | When true, the value list height is adjusted automatically so that only complete items are shown in the list |
HorizontalScrollBar | Design-only | bool | — | A horizontal scrollbar is shown when true so the user can scroll to see items wider than the list |
OnSelectionChangedSend | Design-only | string | — | Sets the command sent to a remote device when a new item is selected from the list |
ScrollAlwaysVisible | Design-only | bool | — | When true, scroll bars are always shown regardless of the number of items in the list |
SelectedIndex | Read/write | int | SetListIndex | The row number of the selected item (starting from 0). Only supported when SelectionMode is One |
SelectedName | Read/write | int | SetListName | The name of the selected item. Only supported when SelectionMode is One |
ShowItemValue | Design-only | bool | — | Set to true to display the value associated with each item; false to show only the value’s name |
Value | Read/write | UInt32 | SetListValue | The selected value. If multiple values are selected, calculates a bit-wise OR for all selected items |
This control also supports all the common control properties. It also supports the following methods, which can be used when creating serial commands.
Name | Returns | Description |
---|---|---|
ClearListOptions() | void | Removes all options from the list. |
SetListOption(uint Value, string DisplayValue) | void | Sets the text displayed for a list value. If the value isn’t already in the list, it is added. |