Dropdown
[Desktop Automation]
Tips:
- Always create them with id = priority as an ascending integer
- Do not use the write property of selectedindex to change the control's selected item. Use
selecteditem
(which references theid
field ofadditem()
) instead.
Properties
Property | Read/write | Type | Description |
---|---|---|---|
backgroundcolor | Read/write | String | The background color as a string. Format is '$BBGGRR' |
caption | read/write | string | caption of the dropdown |
captionwidth | read/write | number | width of the caption in pixels |
captionwidthpercentage | Read/write | Number | Width of the caption in percentage |
customdraw | Read/write | Boolean | Enable custom drawing of dropdown items (parameters style , fontcolor of method additem has no effect if this member is false (default)); also, backgroundcolor has no effect |
count | read | number | Number of items in the dropdown |
enabled | read/write | Boolean | Shall the dropdown be enabled? |
hint | read/write | string | Hint or tooltip for the dropdown |
onchange | read/write | string | callback function for a change event |
selecteditem | read/write | number | The ID of the selected item (see method additem ) |
selectedindex | read/write | number | The index of the selected item (0-based) |
spacing | read/write | number | spacing of the dropdown |
translatecaption | read/write | Boolean | when true, caption must be a String Identifier |
visible | read/write | Boolean | Shall the dropdown be visible? |
Methods
Name | Syntax | Description |
---|---|---|
additem | dropdown:additem (caption, id, [priority, translate, style, fontcolor]); | Adds an item with a caption and 'id', sorted by 'priority' number ascending. Translate is a Boolean. Style is an integer bitfield for the item's draw style (1=bold, 2=italic, 4=strikeout, 8=underline), fontcolor is the font color. Format is '$BBGGRR' |
clear | dropdown:clear(); | Clears the items in dropdown list. |
getitemparameter | Parameter = dropdown: getitemparameter(Index: Integer); | Get the Parameter (id) of an item at a specific position |
getitemtext | Text = dropdown:getitemtext(Index: Integer); | Get the text of an item at a specific position |
removeitem | dropdown:removeitem(id); | removes an item |
updateitems | dropdown:updateitems(); | Updates all the items added or removed in the list. |