要什么控件
lable+time
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ExtCtrls;
type
TForm1 = class(TForm)
Label1: TLabel;
Button1: TButton;
Timer1: TTimer;
procedure FormCreate(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.FormCreate(Sender: TObject);
begin
Label1.Caption:='测试';
Label1.Font.Color:=clRed;
Label1.Font.Size:=20;
Label1.AutoSize:=true;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
if Label1.Left < Width then
Label1.Left:=Label1.Left+1
else
Label1.Left:=0;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
Timer1.Interval:=100;
Timer1.Enabled:=true;
end;
end.