unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls;
type
TForm1 =
class(TForm)
Panel1: TPanel;
Timer1: TTimer;
procedure FormCreate(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
myLabel : TLabel;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
myLabel := TLabel.Create(Panel1);
myLabel.Parent := Panel1;
myLabel.Caption := '
Testtext';
myLabel.AutoSize := True;
myLabel.Left := (Panel1.Width - myLabel.Width)
div 2;
myLabel.Top := (Panel1.Height - myLabel.Height)
div 2;
Timer1.Interval := 10;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
if myLabel.left = -myLabel.width
then
myLabel.left := Panel1.width
else myLabel.left := myLabel.Left -1;
end;
end.