unit Poly3;

//---------------------------------------------------
// OBUTTON3 muss als Komponente installiert sein !!!
//---------------------------------------------------

interface

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

type
  TForm1 = class(TForm)
    OButton1: TOButton;
    procedure FormCreate(Sender: TObject);
    procedure OButton1Click(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

const
  FMax = 16;
  Farbe: Array[0..FMax-1] of TColor =
   (clBlack, clMaroon, clGreen, clNavy, clTeal, clPurple,
    clOlive, clGray, clSilver, clRed, clLime, clBlue,
    clAqua, clFuchsia, clYellow, clWhite);

var
  Form1: TForm1;

implementation

{$R *.DFM}

{Die Methode SetColor ist als public vereinbart}

procedure TForm1.FormCreate(Sender: TObject);
begin
  randomize;
end;

procedure TForm1.OButton1Click(Sender: TObject);
begin
  OButton1.SetColor (Farbe[random(16)]);

end;

end.
