unit Main;

interface

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

type
  TForm2 = class(TForm)
    GroupBox1: TGroupBox;
    Label1: TLabel;
    lblPROCENT: TLabel;
    ProgressBar1: TProgressBar;
    ProgressBar2: TProgressBar;
    Panel2: TPanel;
    btnCLOSE: TBitBtn;
    btnSTART: TBitBtn;
    procedure btnSTARTClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form2: TForm2;

implementation
{$R *.dfm}

procedure TForm2.btnSTARTClick(Sender: TObject);
var
	lp : Integer;
	kk : Integer;

begin
   ProgressBar1.Max := 100;
   ProgressBar2.Max := 1000000;

	for lp := 1 to 100 do
	begin
   	for kk := 1 to 1000000 do
      begin
   	   ProgressBar2.Position := ProgressBar2.Position + 1;
      	lblPROCENT.Caption := IntToStr(ProgressBar1.Position);

         if (kk mod 10000) = 0 then
         begin
		      ProgressBar1.Position := ProgressBar1.Position + 1;
         end;
	      Application.ProcessMessages();
      end;
   end;
end;

end.
