Wednesday, January 5, 2011

Adding a Stringlist to a Combo Box

{
I have several combo boxes that I wish to populate at the form creation.
The problem is that I keep getting duplicate values.
}
var
 SList : TStringList;begin
 SList := TStringList.Create;
 SList.sorted := True;
 SLIST.Duplicates := dupIgnore;
 SList.Add('Dog');  {Only one 'Dog' goes in the list}
 SList.Add('cat');
 SList.Add('Dog');
 ComboBox1.Items.Assign(SList);
 SList.free;end;

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Kang Iwan K-sev | Thank's for your visit To My Site - Ridwan Mulyana | Cibeureum