RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TDBListBox.Items Property

Lists the strings that appear in the list box.

Pascal
property Items: TStrings;
C++
__property TStrings Items;

Use Items to specify the values the user can choose from. Because Items is an object of type TStrings, you can add, delete, insert, and move items using the Add, Delete, Insert, Exchange, and Move methods of the TStrings object. For example, to add each string to the listbox, write code such as the following:

while not CountryTbl.Eof do begin
  DBListBox1.Items.Add(CountryTbl.FieldByName('Country').AsString);
  CountryTbl.Next;
end;

 

DBListBox1->Items->Add("AFieldValue");

Note: The ItemIndex property determines which item is selected, if any.
 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!