tabset+nodebook多面页应用

//关联tabset+nodebook

procedure TForm1.FormCreate(Sender: TObject);
begin
  ts1.Tabs := nb1.Pages;
end;

//tabset对nodebook进行切换

procedure TForm1.ts1Click(Sender: TObject);
begin
  nb1.PageIndex := ts1.TabIndex;
end;

  //删除当前tabset和nodebook

procedure TForm1.del1Click(Sender: TObject);
begin
  if (nb1.Pages.Count > 1) and not(nb1.ActivePage='Default') then
  begin
    nb1.Pages.Delete(nb1.PageIndex);
    ts1.Tabs := nb1.Pages;
  end;
  //移动到最后
  nb1.PageIndex := nb1.Pages.Count - 1;
  ts1.TabIndex := nb1.PageIndex;
end;

//添加NODEBOOK

procedure TForm1.NewForm1Click(Sender: TObject);
begin
  nb1.Pages.Add('Tmp');
  ts1.Tabs := nb1.Pages;
  ts1.TabIndex := nb1.Pages.Count - 1;
  ts1.TabIndex := nb1.PageIndex;
end;

你可能感兴趣的:(node)