: Hello,
:
: Yes, i am working with a database, however that is not quite what I need. I don't need to perform a query for the combobox items. Basically what the program is doing is maintaining a database which will sort a baseball/football, etc card collection. The database contains items such as LastName, FirstName, CardNumber, CardYear, Value, etc.
:
: What I am trying to do is to have team lists saved off in a TStringList or something to that effect, and then just set the combobox's items to that list depending up on which radio button was selected. However I have yet to find a way to change the combobox's items.
:
: Let me know if you have any ideas or need more info.
:
: Thanks alot.
: *----------------------------------------*
:
: There are two ways to write error-free programs; only the third one works.
:
:
:
:
The Items of a combobox are stored in a TStrings object, which is also an ancestor of the TStringList object. So to copy the values from a TStringList into the Items, the only code you need is this:
ComboBox1.Items := SomeStringList;
Alternatively, you can also use this, which shows what's happening:
ComboBox.Items.Clear;
for i := 0 to SomeStringList.Count-1 do
ComboBox.Items.Add(SomeStringList[i]);
This code can also be used to copy part of the SomeStringList into the ComboBox.