unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ImgList, ExtCtrls;
type
TForm1 =
class(TForm)
LKopftoderZahl: TLabel;
BBeenden: TButton;
BMuenzewerfen: TButton;
LKopf: TLabel;
IKopf: TImage;
IZahl: TImage;
procedure BBeendenClick(Sender: TObject);
procedure BMuenzewerfenClick(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
operation: integer;
implementation
{$R *.dfm}
procedure TForm1.BBeendenClick(Sender: TObject);
begin
close
end;
procedure TForm1.BMuenzewerfenClick(Sender: TObject);
begin
//zufällige Operation
operation := random(2) + 1;
case operation
of
1 :
begin
LKopf.Caption := '
Kopf';
IKopf.Picture.Bitmap.LoadFromFile ('
MuenzeKopf.bmp');
end;
2 :
begin
LKopf.Caption := '
Zahl';
IZahl.Picture.Bitmap.LoadFromfile ('
MuenzeZahl.bmp');
end;
end;