Show: Delphi C++
Display Preferences

Vcl.StdCtrls.TCustomListBox.Items

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property Items: TStrings read FItems write SetItems;

C++

__property System::Classes::TStrings* Items = {read=FItems, write=SetItems};

Properties

Type Visibility Source Unit Parent
property public
Vcl.StdCtrls.pas
Vcl.StdCtrls.hpp
Vcl.StdCtrls TCustomListBox

Description

Contains the strings that appear in the list box.

Use Items to add, insert, delete and move items. By default, the items in a list box are of type TStrings. Use this item type to access its methods or properties to manipulate the items in the list.

For example, the following code snippet shows how to add the text in the edit box to the list box as an item:

  ListBox1.Items.Add(Edit1.Text);
  ListBox1->Items->Add(Edit1->Text);
Tip: If you have a list box with multiple columns and you want to add data to specific columns, then you need to use the ^I parameter (that is, capital i; Delphi-only) in the Add statement, as shown in the snippet below.
  ListBox1.Items.Add('First Column'^I'Second Column');
  ListBox1.Items.Add('1'^I'2');
  ListBox1.Items.Add('4'^I'5');

And the result would be:

ListBoxIParam.png

See Also

Code Examples

Personal tools
In Other Languages
Previous Versions
Assistance