unit Unit11;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ExtCtrls, ComCtrls,Printers, Buttons, Grids;

type
  TForm1 = class(TForm)
    PageControl1: TPageControl;
    TabSheet1: TTabSheet;
    TabSheet2: TTabSheet;
    Image1: TImage;
    StaticText1: TStaticText;
    PageControl2: TPageControl;
    TabSheet3: TTabSheet;
    TabSheet4: TTabSheet;
    TabSheet5: TTabSheet;
    CheckBox1: TCheckBox;
    TabSheet6: TTabSheet;
    TabSheet7: TTabSheet;
    TabSheet8: TTabSheet;
    Label1: TLabel;
    Image2: TImage;
    Memo1: TMemo;
    Label2: TLabel;
    Button4: TButton;
    Label3: TLabel;
    TabSheet9: TTabSheet;
    StringGrid1: TStringGrid;
    procedure CheckBox1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button4Click(Sender: TObject);
    procedure Button6Click(Sender: TObject);
    procedure Button7Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.CheckBox1Click(Sender: TObject);
begin
  PageControl2.MultiLine := CheckBox1.Checked;
  if Checkbox1.Checked then Label1.Caption:='Multiline=true'
  else Label1.Caption:='Multiline=false'
end;

procedure TForm1.Button2Click(Sender: TObject);
var
  i: Integer;
begin
  Checkbox1.Caption := 'Stack Tabs?';
  for i := 0 to 20 do
    with TTabSheet.Create(Self) do
    begin
      PageControl := PageControl2;
      Caption := 'Tab #' + IntToStr(i);
    end;


end;

procedure TForm1.Button4Click(Sender: TObject);
var i:integer;
begin
  for i:=0 to PageControl2.PageCount-1 do
    label2.Caption:=label2.Caption+PageControl2.Pages[i].Caption+#13;
end;

procedure TForm1.Button6Click(Sender: TObject);
begin
   Label1.Caption:=Inttostr(Pagecontrol2.TabIndex);
end;

procedure TForm1.Button7Click(Sender: TObject);
begin
  //Pagecontrol2.Pages[2].Visible:=false;
  Pagecontrol2.SelectNextPage(false);

end;

end.
