unit Main;

interface

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

type
  TForm2 = class(TForm)
    Panel2: TPanel;
    BitBtn1: TBitBtn;
    TabControl: TTabControl;
    Memo1: TMemo;
    procedure TabControlChange(Sender: TObject);
    procedure BitBtn1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form2: TForm2;

implementation

{$R *.dfm}

procedure TForm2.BitBtn1Click(Sender: TObject);
begin
	Close();
end;

procedure TForm2.TabControlChange(Sender: TObject);
var
	idx : Integer;

begin
	idx := TabControl.TabIndex;
   ShowMessage('Zakładka nr ' + IntToStr(idx));
end;

end.

