我现在做的MID窗口父窗体调用子窗体时我用   
if application.FindComponent('表单')<>nil then
 表单.WindowState:=wsnormal
 else
 begin
 表单:=t表单.Create(application);
 表单.show;
 end;
关闭时用action:=cafree;
可现在程序速度运行慢的要命!可我以前不用MID 窗口时速度很快呀!这到底是怎么回事!不知大家知道不。或有其他的方法吗?

解决方案 »

  1.   

    if 表单<>nil then
      表单.show
    else
    begin
      表单:= t表单.Create(Self);
      表单.show;
    end;关闭时用
      action:=cafree;
      表单:= nil;
      

  2.   

    if application.FindComponent('表单')<>nil then  //这句影响速度
    你应该这样做
    if assigned(表单) then
    表单.WindowState:=wsnormal
     else
     begin
     表单:=tfrmgys.Create(application);
     表单.show;
     end;
      

  3.   

    关闭时用
      action:=cafree;
      表单:= nil;
      

  4.   

    if application.FindComponent('表单')<>nil then  //这句影响速度
    你应该这样做
    if assigned(表单) then
    表单.WindowState:=wsnormal
     else
     begin
     表单:=tfrmgys.Create(application);
     end;
    表单.show;
      

  5.   

    还是不行啊,速度还是很慢,尤其拖动窗口时!但是不用MDI窗口速度就很快!这是什么原因呢?望大家来指点指点!。
      

  6.   

    if application.FindComponent('表单')<>nil then  //这句影响速度
    你应该这样做
    if assigned(表单) then
    表单.WindowState:=wsnormal
     else
     begin
     表单:=tfrmgys.Create(application);
     end;
    表单.show;