Combo box and tstring lazarus / 9-Editor ---------------------------------------------------------------------- MrFouney · 2009-04-23 16:33 Hello All, I am new to lazarus and used to work with free pascaL I have a combobox on a form,  I want to populate it with data I have from a dynamic list. Wich means not using the "Tstring with the ..." in the properties. How can I do it?  What is the method? and where shall I put it? In Initialize section? Or in procedure like Onselect ? If someone as a sample of code it would be great!! Thnak you in advance for your help ---------------------------------------------------------------------- theo · 2009-04-23 19:09 You could put it in the OnCreate event of the Form like Code: [Select]procedure TForm1.FormCreate(Sender: TObject); begin   ComboBox1.Items.Add('test1');   ComboBox1.Items.Add('test2');   ComboBox1.ItemIndex:=0; end; ---------------------------------------------------------------------- Marc · 2009-04-26 17:03 and if you have to add a lot of lines: Code: [Select]procedure TForm1.FormCreate(Sender: TObject); begin   ComboBox1.Items.BeginUpdate;   ComboBox1.Items.Add('test1');   ComboBox1.Items.Add('test2');   ...   ComboBox1.Items.Add('testN');   ComboBox1.Items.EndUpdate;   ComboBox1.ItemIndex:=0; end;