unit Befund1;

interface

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

type
  TForm1 = class(TForm)
    GroupBox1: TGroupBox;
    GroupBox2: TGroupBox;
    GroupBox3: TGroupBox;
    Button1: TButton;
    Button2: TButton;
    Edit1: TEdit;
    Panel1: TPanel;
    ScrollBar1: TScrollBar;
    procedure FormCreate(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure ScrollBar1Change(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

const
  Max = 10;
var
  Form1: TForm1;
  Diagnose: Array[1..Max] of String;
  Nr: Integer;

implementation

{$R *.DFM}

procedure TForm1.FormCreate(Sender: TObject);
begin
  randomize;
  Diagnose[1]  := 'Hm...';
  Diagnose[2]  := 'Das ist ein Ding!';
  Diagnose[3]  := 'Sieh mal an!';
  Diagnose[4]  := 'Was soll ich sagen?';
  Diagnose[5]  := 'Tatsächlich?';
  Diagnose[6]  := 'So geht es dir also.';
  Diagnose[7]  := 'Du hast Probleme.';
  Diagnose[8]  := 'Das kann ich verstehen.';
  Diagnose[9]  := 'Ich bin sprachlos.';
  Diagnose[10] := 'Naja...';
  ScrollBar1.Min := 1;
  ScrollBar1.Max := Max;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  Panel1.Caption := '';
  Edit1.Text := '';
  Edit1.SetFocus;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
  Nr := random (Max) + 1;
  Panel1.Caption := Diagnose[Nr];
end;

procedure TForm1.ScrollBar1Change(Sender: TObject);
begin
  Panel1.Caption := Diagnose[ScrollBar1.Position];	
end;

end.
