unit Unit1;

interface

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

type
  TForm1 = class(TForm)
    Image1: TImage;
    ProgressBar1: TProgressBar;
    Timer1: TTimer;
    Label1: TLabel;
    procedure Timer1Timer(Sender: TObject);
    procedure FormActivate(Sender: TObject);


  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  x:real;

implementation

uses Unit2;

{$R *.dfm}


procedure TForm1.Timer1Timer(Sender: TObject);
begin

if x=1 then
begin
Form1.ProgressBar1.Position:=Form1.ProgressBar1.Position+10;
if Form1.ProgressBar1.Position=100 then
begin
Form1.ProgressBar1.Position:=0;
x:=2;

end;  end;

if x=2 then
begin
Form1.ProgressBar1.Position:=Form1.ProgressBar1.Position+30;
if Form1.ProgressBar1.Position=90 then
begin
Form1.ProgressBar1.Position:=0;
x:=3;
form1.Label1.Caption:='поиск базы данных' ;
end;end;

if x=3 then
begin
Form1.ProgressBar1.Position:=Form1.ProgressBar1.Position+2;
if Form1.ProgressBar1.Position=90 then
begin
Form1.ProgressBar1.Position:=0;
x:=4;
form1.Label1.Caption:='загрузка данных' ;
end;end;

if x=4 then
begin
Form1.ProgressBar1.Position:=Form1.ProgressBar1.Position+1;
if Form1.ProgressBar1.Position=90 then
begin
Form1.ProgressBar1.Position:=0;
x:=5;
form1.Label1.Caption:='завершение загружзки' ;
end;end;


if x=5 then
begin
Form1.ProgressBar1.Position:=Form1.ProgressBar1.Position+5;
if Form1.ProgressBar1.Position=100 then
timer1.Enabled:=false;
Form2.show;
form2.MonthCalendar1.Date:=now();
form2.DateTimePicker1.Date:=now();
form2.DateTimePicker2.Date:=now();
form1.hide;
end;





end;



procedure TForm1.FormActivate(Sender: TObject);
begin
  x:=1;
timer1.Interval:=10;
timer1.Enabled:=true;

end;

  

end.
