在主程序program 中只留主窗体即: program Project1;uses Forms, Unit1 in 'Unit1.pas' {Form1};{$R *.res}begin Application.Initialize; Application.CreateForm(TFmain, fmain);//只留次窗体一个 //application.createform(Tfr_other,fr_other);//删除掉此句 Application.Run; end.其它的窗体只在需用时,创建。例如: button1click(send:Tobject); begin var fr_other:Tfr_other; begin if not assgined(fr_other) then//防止多次创建同一个窗体 begin fr_other:=Tfr_other.create(application); //fr_other.parent:=xxxx; fr_other.show//showmodal; fr_other.free; end; //all thing is ok!!!
Help->IDE command-Line options
-ns("no splash")
-np("no project")不打开空项目
◆◆◆ CSDN查询助手,查询方便快捷 ◆◆◆ 下载地址:
http://CoolSlob.ifood1.com/Download/CSDNFinder.exe
http://CoolSlob.8u8.com/Download/Tools/CSDNFinder.Slob[更名为.exe即可]
program Project1;uses
Forms,
Unit1 in 'Unit1.pas' {Form1};{$R *.res}begin
Application.Initialize;
Application.CreateForm(TFmain, fmain);//只留次窗体一个
//application.createform(Tfr_other,fr_other);//删除掉此句
Application.Run;
end.其它的窗体只在需用时,创建。例如:
button1click(send:Tobject);
begin
var
fr_other:Tfr_other;
begin
if not assgined(fr_other) then//防止多次创建同一个窗体
begin
fr_other:=Tfr_other.create(application);
//fr_other.parent:=xxxx;
fr_other.show//showmodal;
fr_other.free;
end;
//all thing is ok!!!
但这有时候也不能增快多少.我在PB中可以通过postevent推迟触发设置事件来加快启动速度.
在DELPHI中是否也可以呢.---我将一些设置操作事件放在onshow事件中,
而不是都放在oncreate事件中,可以加快一点点.