In Ergänzung zu Marabu ....
Delphi-Quellcode:
TForm1
...
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
private
{ Private-Deklarationen }
procedure farbwechsel(Farbe: integer);
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.farbwechsel(Farbe: integer);
begin
if Farbe = 1
then panel1.color:= clred;
if Farbe = 2
then panel1.color:= clblue;
// else ????
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
farbwechsel(1);
end;