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;
都可以.