Sign in Join
FPDoc Onlineexperiment

TCustomListBox.GetSelectedText function

Member of TCustomListBoxpublicIn unit StdCtrls

Get the text for all selected items as a string value.

Declaration

pascal
function GetSelectedText: string

Function result

The item strings, one per line.

Description

GetSelectedText is a String function used to retrieve a string with all selected items in the control. The return values uses each selected entry in Items separated by the LineEnding character sequence for the platform or operating system. The return value is an empty string ('') when ItemIndex does not contain a positive non-zero value (no item is selected) or SelCount contain 0 (zero).

GetSelectedText iterates over the values in Items, and includes the string when its Selected property is set to True. This is useful when MultiSelect is enabled for the control.

See also

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