unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
procedure animatedisplay(mode:short;delaytime:integer);
var
Form1: TForm1;implementation{$R *.dfm}procedure animatedisplay(mode:short;delaytime:integer);
begin
case mode of
1:animatewindow(form1.Handle,delaytime,aw_blend or aw_activate);
2:animatewindow(form1.Handle,delaytime,aw_center or aw_activate);
3:animatewindow(form1.Handle,delaytime,aw_ver_negative or aw_activate);
4:animatewindow(form1.Handle,delaytime,aw_ver_positive or aw_activate);
end;end;
procedure TForm1.Button1Click(Sender: TObject);
begin
animatedisplay(1,2000);
end;end.
请问高手 为什么我执行了这段程序没有出现动画效果 请指教 谢谢.
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
procedure animatedisplay(mode:short;delaytime:integer);
var
Form1: TForm1;implementation{$R *.dfm}procedure animatedisplay(mode:short;delaytime:integer);
begin
case mode of
1:animatewindow(form1.Handle,delaytime,aw_blend or aw_activate);
2:animatewindow(form1.Handle,delaytime,aw_center or aw_activate);
3:animatewindow(form1.Handle,delaytime,aw_ver_negative or aw_activate);
4:animatewindow(form1.Handle,delaytime,aw_ver_positive or aw_activate);
end;end;
procedure TForm1.Button1Click(Sender: TObject);
begin
animatedisplay(1,2000);
end;end.
请问高手 为什么我执行了这段程序没有出现动画效果 请指教 谢谢.
这句调用应该放在Form的OnCreate事件里
procedure animatedisplay(mode:short;delaytime:integer);
begin
case mode of
1:animatewindow(form2.Handle,delaytime,aw_blend or aw_activate);
2:animatewindow(form2.Handle,delaytime,aw_center or aw_activate);
3:animatewindow(form2.Handle,delaytime,aw_ver_negative or aw_activate);
4:animatewindow(form2.Handle,delaytime,aw_ver_positive or aw_activate);
end;end;
procedure TForm1.Button1Click(Sender: TObject);
begin
animatedisplay(1,2000);
end;