首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

delphi窗口有关问题

2012-08-03 
delphi窗口问题一个小程序,让图片不断弹出,但弹出一定程度资源耗尽,程序就死啦,怎么能让图片边创建边关闭

delphi窗口问题
一个小程序,让图片不断弹出,但弹出一定程度资源耗尽,程序就死啦,怎么能让图片边创建边关闭原来的图片
程序地址http://115.com/file/e7xc1dkj#pandora进行曲.zip

[解决办法]

最简单的方法, 保存之前创建的窗体. 比如这样保存
CompList: array[0..49] of TComponentClass;

把窗体创建方法
Application.CreateForm(TForm1, Form1);
改为
var
 frmTmp: TForm1;

frmTmp:= TFomr1.Create(self);
CompList[i]:= TComponentClass(frmTmp);

随机把某个窗体切换到前端
用TForm(CompList[i]).Show; 或者 TForm(CompList[i]).BringToFront;

都可以.

热点排行