Sign in Join
FPDoc Onlineexperiment

TCustomListBox.AddItem procedure

Member of TCustomListBoxpublicIn unit StdCtrls

Adds an item to the list.

Declaration

pascal
procedure AddItem(const Item: string; AnObject: TObject)

Arguments

Item

The item text.

AnObject

The associated object, or Nil when not used.

Description

AddItem is a method used to add a string (and an optional associated object) to the Items for the control. AddItem calls the AddObject method in Items using Item and AnObject as arguments.

Item contains the string value added to the Items in the control.

AnObject is an optional object instance associated with the item, and contains Nil when an object instance has not been assigned. The object can be retrieved using the Items.Objects property for the ItemIndex, and must be cast to the required class type to access values in the object instance.

See also

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