这个窗体有什么特征吗?例如:知道名字,或是MDI子窗体等

解决方案 »

  1.   

    判断MDI子窗体是否创建
    procedure OpenForm(FormClass: TFormClass; var fm; AOwner:TComponent);
    var
      i: integer;
      Child:TForm;
    begin
      for i := 0 to Screen.FormCount -1 do
          if Screen.Forms[i].ClassType=FormClass then
          begin
            Child:=Screen.Forms[i];
            if Child.WindowState=wsMinimized then
               ShowWindow(Child.handle,SW_SHOWNORMAL)
            else
               ShowWindow(Child.handle,SW_SHOWNA);
            if (not Child.Visible) then Child.Visible:=True;
            Child.BringToFront;
            Child.Setfocus;
            TForm(fm):=Child;
            exit;
          end;
      Child:=TForm(FormClass.NewInstance);
      TForm(fm):=Child;
      Child.Create(AOwner);
    end;
      

  2.   

    if Assigned(Form1) then
       // 实例已经创建;if Form1.Showing then
      // 窗体已经显示;
      

  3.   

     谢谢 各位!!to 
    Apollo47(阿波罗)  简单明了!!