it works on the combobox.items but not in tabcontrol.tabs and both use tstrings
tmyclass = class
tt : integer;
a : string;
end;
.
.
.
procedure TForm1.Button1Click(Sender: TObject);
var
i : integer;
temp : tmyclass;
begin
for i := 1 to 10 do
begin
temp := tmyclass.Create;
temp.a:='object#'+inttostr(i);
temp.tt:=i;
ComboBox1.Items.AddObject(temp.a,temp);
TabControl1.Tabs.AddObject(temp.a,temp);
end;
for i := 0 to ComboBox1.Items.Count-1 do
begin
showmessage(inttostr(tmyclass(ComboBox1.Items.Objects[i]).tt));
showmessage(inttostr(tmyclass(TabControl1.tabs.Objects[i]).tt));
end;
end;