想做个窗体逐渐消失的效果,请问有什么简单方法,谢谢

welot 2006-08-13 05:51:19
窗体逐渐消失,到完全不见时,关闭窗口

我想实现这个效果,请问在Delphi 6里有什么简单方法?谢谢
...全文
175 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
wudi_1982 2006-08-13
  • 打赏
  • 举报
回复
截获WM_CLOSE消息,然后自己作出关闭效果的处理后,再执行关闭代码

下面给你个例子,截获WM_CLOSE消息,这里这是简单的把窗体的宽度逐渐减一
unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons, ExtCtrls;

type
TForm1 = class(TForm)
BitBtn1: TBitBtn;

private
procedure WMClose(var Message: TWMClose); message WM_CLOSE;
public

end;

var
Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.WMClose(var Message: TWMClose);
var
I :integer;
begin

if Message.Msg = WM_CLOSE then
begin
for I := 0 to Width do
begin //你可以在这里处理,做出你想要的效果,我这只是一个例子
Form1.Width := form1.Width -1;
end;
end;
inherited;
end;

end.
postren 2006-08-13
  • 打赏
  • 举报
回复
1. Form1.AlphaBlend := True;
2.在定时器中递减 Form1.AlphaBlendValue,递减步长自己规定,递减到0了就看不到了,255是完全显示
Windows 2000以上系统适用

16,742

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 语言基础/算法/系统设计
社区管理员
  • 语言基础/算法/系统设计社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧