Hai Hallo_Thomas,
ich habe das jetzt mal auf die Schnelle so gemacht:
Delphi-Quellcode:
type
TForm1 = class(TForm)
Anzeige: TListBox;
Ende: TButton;
SpeedButton1: TSpeedButton;
SpeedButton3: TSpeedButton;
SpeedButton6: TSpeedButton;
SpeedButton7: TSpeedButton;
Label1: TLabel;
procedure EndeClick(Sender: TObject);
procedure AllButonsClick(Sender: TObject);
private
{ Private-Deklarationen }
counter : Integer;
public
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.EndeClick(Sender: TObject);
begin
close;
SpeedButton1.OnClick := AllButonsClick;
SpeedButton1.Tag := 1;
SpeedButton3.OnClick := AllButonsClick;
SpeedButton3.Tag := 3;
SpeedButton7.OnClick := AllButonsClick;
SpeedButton7.Tag := 10;
SpeedButton6.OnClick := AllButonsClick;
SpeedButton6.Tag := 6;
end;
procedure TForm1.AllButonsClick(Sender: TObject);
var
foo : Integer;
begin
foo := (Sender AS TSpeedButton).Tag;
Anzeige.Items.Insert(0,IntToStr(foo));
if (foo in [1,3,10]) then
begin
inc (counter);
end;
if (foo = 6) then
begin
counter := 0;
end;
Label1.Caption:= IntToStr(Counter) ;
end;
Stephan B.
"Lasst den Gänsen ihre Füßchen"