Sign in Join
FPDoc Onlineexperiment

TCustomListBox.Selected property

Member of TCustomListBoxpublicIn unit StdCtrls

The Selected state for an item in the control.

Declaration

pascal
property Selected[Index: Integer]: Boolean read GetSelected write SetSelected;

Description

Selected is an indexed Boolean property used to set the selection state for an item defined in the list box control.

The index value is the ordinal position in Items with the selection state value. Read and write access for the property value call the CheckIndex method to verify that the index is in bounds for the defined Items in the control. CheckIndex raises an exception if an index value is not in the required range.

Property values are read from the widgetset class when it has been created, or from the cached selection values when it has not. Write access ensures that ItemIndex is updated as needed, and notifies the widgetset class and/or the item selection cache when a value is changed.

Use SelectAll to set the selection state for all Items in the control.

Use SelectRange to set the selection state for Items in the specified range of positions in the control.

Use ClearSelection to reset the selection state for all Items in the list box control.

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.