在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
1、先添加一个Timer控件,其Interval属性设置为50。 2、再添加一个Label控件,Name为Label1。 3、然后在Timer的OnTimer事件添加如下代码: 1 unit Unit13; 2 3 interface 4 5 uses 6 Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, 7 Dialogs, StdCtrls, ExtCtrls, jpeg; 8 9 type 10 TForm13 = class(TForm) 11 Timer1: TTimer; 12 Label1: TLabel; 13 Image1: TImage; 14 procedure Timer1Timer(Sender: TObject); 15 private 16 { Private declarations } 17 public 18 { Public declarations } 19 end; 20 21 var 22 Form13: TForm13; 23 24 implementation 25 26 {$R *.dfm} 27 28 procedure TForm13.Timer1Timer(Sender: TObject); 29 begin 30 Self.Label1.Left := Self.Label1.Left - 1 ; 31 if Self.Label1.Left + Self.Label1.Width = 0 then 32 Self.Label1.Left := Form13.Width; 33 34 end; 35 36 end. 效果图:
1、先添加一个Timer控件,其Interval属性设置为50。 2、再添加一个Label控件,Name为Label1。 3、然后在Timer的OnTimer事件添加如下代码: 1 unit Unit13; 2 3 interface 4 5 uses 6 Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, 7 Dialogs, StdCtrls, ExtCtrls, jpeg; 8 9 type 10 TForm13 = class(TForm) 11 Timer1: TTimer; 12 Label1: TLabel; 13 Image1: TImage; 14 procedure Timer1Timer(Sender: TObject); 15 private 16 { Private declarations } 17 public 18 { Public declarations } 19 end; 20 21 var 22 Form13: TForm13; 23 24 implementation 25 26 {$R *.dfm} 27 28 procedure TForm13.Timer1Timer(Sender: TObject); 29 begin 30 Self.Label1.Left := Self.Label1.Left - 1 ; 31 if Self.Label1.Left + Self.Label1.Width = 0 then 32 Self.Label1.Left := Form13.Width; 33 34 end; 35 36 end. 效果图:
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论