Registriert seit: 1. Aug 2007
Ort: Ludwigshafen am Rhein
1.529 Beiträge
Delphi 7 Professional
|
Re: break it problem
31. Jan 2010, 20:03
Delphi-Quellcode:
implementation
{$R *.dfm}
var
x,y: integer;
procedure TForm1.Timer1Timer(Sender: TObject);
var x,y:integer;
begin
if (Shape1.Top <= 0) or (Shape1.Top >= image1.ClientHeight - Shape1.Height) then
begin
y := -y;
end;
if (Shape1.Left <= 0) or (Shape1.Left >= image1.ClientWidth - Shape1.Width) then
begin
x := -x;
end;
Shape1.Left := Shape1.Left + x;
Shape1.Top := Shape1.Top + y;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
// fehlendes... (hab ich zu voreilig gelöscht)
x := 5;
y := 5;
end;
Bernhard
Bernhard Iliacos intra muros peccatur et extra!
|