procedure TForm1.FormCreate(Sender: TObject);
var
i: Integer;
const
colorarray : Array[0..4] of TColor = (
clYellow, clGreen, clBlue, clLime, clFuchsia);
begin
for i := 0 to PageControl1.PageCount - 1 do
begin
PageControl1.Pages[i].Brush.Color := colorarray[i];
ComboBox1.Items.AddObject(PageControl1.Pages[i].Name,
PageControl1.Pages[i]);
end;
ComboBox1.ItemIndex := 0;
PageControl1.ActivePage := TTabSheet(ComboBox1.Items.Objects[ComboBox1.ItemIndex]);
end;
procedure TForm1.ComboBox1Change(Sender: TObject);
begin
if (Sender is TComboBox) then
with (Sender as TComboBox) do
PageControl1.ActivePage := TTabSheet(Items.Objects[ItemIndex]);
end;