每按一下Button1增加5个Tab:
procedure TForm1.Button1Click(Sender: TObject);
var
i: Integer;
begin
with PageControl1 do
for i := 0 to 5 do
with TTabSheet.Create(Self) do
begin
PageControl := PageControl1;
Pages[i].TabVisible := (i mod 2 = 0);
Caption := 'PageIndex: ' +
IntToStr(Pages[i].PageIndex) + ' TabIndex: ' +
IntToStr(Pages[i].TabIndex);
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
i: Integer;
begin
with PageControl1 do
for i := 0 to 5 do
with TTabSheet.Create(Self) do
begin
PageControl := PageControl1;
Pages[i].TabVisible := (i mod 2 = 0);
Caption := 'PageIndex: ' +
IntToStr(Pages[i].PageIndex) + ' TabIndex: ' +
IntToStr(Pages[i].TabIndex);
end;
end;
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货