application.createform(txxx,xxx);
xxx.showmodal;
xxx.destroy;// xxx.free;
xxx.showmodal;
xxx.destroy;// xxx.free;
解决方案 »
- 在设计多线程下载时我联想到这么个画面,有什么设计模式可以处理么
- DELPHI+ADO+ORACLE 三层更新问题? 急
- 关于权限,大家都可以进来说N句,谢谢各位
- 我的机器昨天突然死机了 开机按扭 和 重启 都不好使了 只能通过 拔掉电源开关 重新启动 有时候
- dbedit简单问题
- Delphi中如何编程处理数据库中的CLOB对象(二进制字符大对象)
- 数据刷新问题
- 怎样一次性删除数据库表中所有重复的记录?
- ”存储过程“门外汉
- 求能显示会计科目的DBTreeView构件(带源码100分,不带源码的50分)
- 如何在固定数量线程之间协调?。。。。高分求解!!!
- 急的问题,WordApplication.Document.Open中的参数怎么给啊
application.createform(tform2,form2);
form2.show;
然后把所有form的控件都free掉,(包括最后form2.free),但是占用的内存一点都没减少
WHY?
Screen.Cursor:=crHourGlass; 我动态创建窗体使用方法是
var
Form1:TForm1;
begin
Form1:=TForm1.Create(Application);
Form1.ShowModal();
Form1.Free();
end;
如果仍然慢,很有可能在FormOnCreate事件中有太多的事要做,可以分出去点。
另外如果有连接数据库,那么是会慢的。
Var Mutex: THandle;
begin
Mutex:= CreateMutex(nil,true,'SingleApp');
if GetLastError<>Error_Already_Exists then
begin
...
Application.CreateForm(Txxx,xxx);
Application.Show();
...
end
else
begin
{给出提示说应用程序实例已经在运行}
end;
var
AppWnd: HWND;
begin
AppWnd := FindWindow('TApplication', 在此填入Application的Title如'hello' );
if AppWnd <> 0 then //已有实例在运行
begin
if IsIconic(AppWnd) then ShowWindow(AppWnd, SW_RESTORE)
else
SetForegroundWindow(AppWnd);
Exit;
end;
Application.Initialize;
Application.Title := 'hello';
Application.CreateForm(TMainForm, MainForm);
....