DlgListBox.SetItemProperties

DlgListBox.SetItemProperties ( 

number ControlID,

number Index,

table  Properties )

Description

Sets the properties of an item in a list box control given its index.

Note: This action will only work if called from a screen's events and if the named control is on the current screen.

Parameters

ControlID

(number) The numeric ID of the list box control whose item properties you want to set.

Index

(number) The index of the item whose properties you want to set. The first item in the list has an index of 1. You can use -1 to set the properties of the last item in the list.

Properties

(table) A table containing the list box item's properties indexed by the following keys:

KEY

TYPE

DESCRIPTION

Checked

boolean

Whether or not to "check" the list box item. This key is only valid if the list box is using the Checklist Box style. If set to true, the item is checked, and if set to false, the item is unchecked. You can set this value using tb.Checked=true, or {Checked=true}.

ItemData

string

The associated data string to set for the item. You can set this value using tb.ItemData="New Item Data" or {ItemData="New Item Data."

Selected

boolean

Whether or not to select the list box item. If set to  true, the item is selected and if set to false, it is deselected. You can set this value using tb.Selected=true or {Selected=true}.

Text

string

The new text you want to set for list box item. You can set this value using tb.Text = "New Text", or {Text="New Text"}.

Note: All changes will be made immediately (based on the update state from DlgListBox.SetUpdate) and only the properties that you want to change need to be set.

Returns

Nothing. You can use Application.GetLastError to determine whether this action failed, and why.

See also:  Related Actions