SelectItem

[method icon] SelectItem(iHandle)

Used to select an item in the drop down list by handle value

iHandle Integer

Applies to: ComboBox , Grid , GridCell , KCMLEdit , List Box

Introduced in KCML version 6.60


>SelectItem

SelectItem

This method is used to select an item in a list box or drop down list. When used with a boolean argument it can also be used to deselect an item in a list box.

Use with list boxes and drop down lists

The single argument form of this method selects the item identified by the handle.

For example:

 Handle = .ListControl1.Add(ItemText$)
 REM Select the item
 .ListControl1.SelectItem(Handle)

Use with list boxes

For multiple selection list boxes there a form which takes a boolean argument is provided. This allows items to be selected or deselected. This form also works with a single selection listbox, in which case only one item at a time will remain selected.

For example:

 Handle = .ListControl1.Add(ItemText$)
 REM Select the item
 .ListControl1.SelectItem(Handle, TRUE)
 REM Deselect the item
 .ListControl1.SelectItem(Handle, FALSE)

See also

ComboBox methods, properties and events. Grid methods, properties and events. GridCell methods, properties and events. KCMLEdit methods, properties and events. List Box methods, properties and events.