我看到一些程序如豪杰超级解霸在播放的时候程序的图标是动态的,请问如何在DELPHI中实现
解决方案 »
- 请问delphi7.0中有没有一个框架的控件或者那有第三方的控件,谢谢!
- 最小化程序时,占用内存为何会减少?
- Delphi 7无法进行正常调试?!!
- 如何使dblookupcombobox直接显示数据集中的第一条记录?在线等待
- 有认知道厘米和象素的关系
- 孩子取名加分!还有400分!请其他二等奖和三等奖得主上台领奖!
- 谁介绍一本讲DELPHI类比较详细的书(最好是电子书)。
- 高手帮忙,为什么不能insert/delete?先谢了。
- 在2000下编译好的程序,为什么在98下连接不上WordApplication?
- 在paradox里如何得到一个已知表的SQL表结构定义语句
- 许久没有接触Delphi,又开始使用Delphi做东西了!(散分)
- 请问如何才能成为高手?
timer事件
var i:integer;
begin
case i do
1:显示图片1;
2:显示图片2;
3:i:=1;
end;
i:=i+1;
end;
StdCtrls, ExtCtrls, SysUtils;type
TWorldForm = class(TForm)
WorldButton: TBitBtn;
Timer1: TTimer;
Label1: TLabel;
procedure WorldButtonClick(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
Count: Integer;
public
{ Public declarations }
end;var
WorldForm: TWorldForm;implementation{$R *.DFM}procedure TWorldForm.WorldButtonClick(Sender: TObject);
begin
if Timer1.Enabled then
begin
Timer1.Enabled := False;
WorldButton.Caption := '&Start';
end
else
begin
Timer1.Enabled := True;
WorldButton.Caption := '&Stop';
end;
end;procedure TWorldForm.Timer1Timer(Sender: TObject);
begin
Count := (Count mod 16) + 1;
Label1.Caption := 'Displaying image ' + IntToStr (Count);
WorldButton.Glyph.LoadFromFile ('w' + IntToStr (Count) + '.bmp');
end;procedure TWorldForm.FormCreate(Sender: TObject);
begin
Count := 1;
end;end.
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ComCtrls, StdCtrls;type
TForm1 = class(TForm)
Button1: TButton;
Animate1: TAnimate;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.DFM}procedure TForm1.FormCreate(Sender: TObject);
var
hDiff: Integer;
begin
Animate1.Parent := Button1;
hDiff := Button1.Height - Animate1.Height;
Animate1.SetBounds (hDiff div 2, hDiff div 2,
Animate1.Width, Animate1.Height);
Animate1.Active := True;
end;end.
unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ImgList, ExtCtrls;type
TForm1 = class(TForm)
Timer1: TTimer;
ImageList1: TImageList;
procedure Timer1Timer(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
public
{ Public declarations }
end;var
Form1: TForm1;
IconIndex:integer;
implementation{$R *.dfm}{ TForm1 }procedure TForm1.Timer1Timer(Sender: TObject);
begin
IconIndex := IconIndex mod ImageList1.Count;
ImageList1.GetIcon(IconIndex,Self.icon);
Inc(IconIndex);
end;procedure TForm1.FormCreate(Sender: TObject);
begin
IconIndex := 0;
end;end.
我手头没delphi没法试。
2在窗体上放一个TIME时间控件,之后在TIME控件的Timer事件中放入一个循环分别改变窗体的图标为IMAGE空间中的图标句柄