
29.01.2009, 15:29
|
Активный
|
|
Регистрация: 23.05.2008
Адрес: Россия, Уфа
Сообщения: 203
Репутация: 1
|
|
Помогите!
Написал такой код:
Код:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, Buttons;
type
TPoint=record
x,y: integer;
end;
TForm1 = class(TForm)
Timer1: TTimer;
s: TSpeedButton;
procedure Timer1Timer(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
i : integer;
Form1: TForm1;
implementation
{$R *.dfm}
function MovePointRound(x1,y1,x2,y2,l,i : Integer): TPoint;
begin
x1 := x2+Round(l*cos(i));
y1 := y2+Round(l*sin(i));
end;
procedure TForm1.Timer1Timer(Sender: TObject);
var
p : Tpoint;
begin
p := MovePointRound(s.Left,s.Top,500,500,79,i);
s.Left := p.x;
s.Top := p.y;
i := i + 10;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
i := 10;
end;
end.
Почему он не работает? Кнопка замирает влевом верхнем углу! 
__________________
Я ни в чем никогда не уверен... И в этом тоже...
|