unit Unit1;

interface

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

type
  TForm1 = class(TForm)
    ProgressBar1: TProgressBar;
    ScrollBar1: TScrollBar;
    CheckBox1: TCheckBox;
    RadioButton1: TRadioButton;
    RadioButton2: TRadioButton;
    RadioButton3: TRadioButton;
    Panel1: TPanel;
    RadioButton4: TRadioButton;
    RadioButton5: TRadioButton;
    RadioButton6: TRadioButton;
    RadioButton7: TRadioButton;
    RadioButton8: TRadioButton;
    RadioButton9: TRadioButton;
    Timer1: TTimer;
    Timer2: TTimer;
    Button1: TButton;
    Button2: TButton;
    procedure Button2Click(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure Timer2Timer(Sender: TObject);
    procedure Timer1Timer(Sender: TObject);
    procedure RadioButton9Click(Sender: TObject);
    procedure RadioButton8Click(Sender: TObject);
    procedure RadioButton7Click(Sender: TObject);
    procedure RadioButton6Click(Sender: TObject);
    procedure RadioButton5Click(Sender: TObject);
    procedure RadioButton4Click(Sender: TObject);
    procedure RadioButton3Click(Sender: TObject);
    procedure RadioButton2Click(Sender: TObject);
    procedure RadioButton1Click(Sender: TObject);
    procedure CheckBox1Click(Sender: TObject);
    procedure ScrollBar1Change(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

uses Unit2;

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
Form2.Show;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
Form2.Hide;
Form2.ShowModal;
end;

procedure TForm1.CheckBox1Click(Sender: TObject);
begin
ProgressBar1.Smooth:=CheckBox1.Checked;
end;

procedure TForm1.RadioButton1Click(Sender: TObject);
begin
ScrollBar1.Position:=ScrollBar1.Min;
end;

procedure TForm1.RadioButton2Click(Sender: TObject);
begin
ScrollBar1.Position:=(ScrollBar1.Min+ScrollBar1.Max) div 2;
end;

procedure TForm1.RadioButton3Click(Sender: TObject);
begin
ScrollBar1.Position:=ScrollBar1.Max;
end;

procedure TForm1.RadioButton4Click(Sender: TObject);
begin
Panel1.Color:=clBtnFace;
end;

procedure TForm1.RadioButton5Click(Sender: TObject);
begin
Panel1.Color:=clBackground;
end;

procedure TForm1.RadioButton6Click(Sender: TObject);
begin
Panel1.Color:=clWhite;
end;

procedure TForm1.RadioButton7Click(Sender: TObject);
begin
Panel1.Color:=clBlack;
end;

procedure TForm1.RadioButton8Click(Sender: TObject);
begin
Panel1.Color:=clGreen;
end;

procedure TForm1.RadioButton9Click(Sender: TObject);
begin
Panel1.Color:=clYellow;
end;

procedure TForm1.ScrollBar1Change(Sender: TObject);
begin
ProgressBar1.Position:=ScrollBar1.Position;
end;

procedure TForm1.Timer1Timer(Sender: TObject);
begin
if ScrollBar1.Position>=ScrollBar1.Max
  then Timer1.Enabled:=False
  else ScrollBar1.Position:=ScrollBar1.Position+1;
end;

procedure TForm1.Timer2Timer(Sender: TObject);
begin
Timer2.Enabled:=False;
Form1.Color:=clLime;
end;

end.
