很简单,你可以利用form的hint来判断,
例如:
1. base_deviceTypeForm :=  Tbase_deviceTypeForm.Creat(application);
   base_deviceTypeForm.hint:='a';然后在生成的时候判断一下hint就可以了! 
  

解决方案 »

  1.   

    if not assigned(base_devicetypeform) then
    begin
    base_deviceTypeForm :=  Tbase_deviceTypeForm.Creat(self);
    base_deviceTypeForm.Show;
    end;
    在base_devicetypeform的onclose里
    action:=cafree;
    在base_devicetypeform的ondestroy里
    base_devicetypeform:=nil
      

  2.   

    给你创建的窗口增加一个识别属性,或使用Tag值,在下一次创建时,遍历所有子窗口,是否找到相同的识别属性,是就激活,否就创建
      

  3.   

    MDI不好控制,我现在都是直接用SDI窗口,里面放容器,把其它窗口放在这些容器中。
      

  4.   

    使用 findcompoent去查找该form在不在,如果在就不创建,不在就创建,这样就可以啦
      

  5.   

    这个问题我答过啊,怎么老有人问的。1、将子窗改成动态创建。
    2、在主窗内定义一function
    procedure TfrmMain.showform(FormClass: TFormClass);
    var
      i: integer;
    begin
      for i := 0 to self.MDIChildCount - 1 do
        if (MDIChildren[i] is FormClass) then
        begin
          self.MDIChildren[i].BringToFront;
         // sendmessage(MDIChildren[i].handle,wm_syscommand,SC_RESTORE,0);
          MDIChildren[i].SetFocus;
          Exit;
        end;
      FormClass.Create(self);
    end;
    3、调出子窗时用
    procedure TfrmMain.N3Click(Sender: TObject);
    begin
        showform(Tfrmcbywcl);//frmcbywcl为子窗的name
    end;
      

  6.   

    写一个查找函数,如果找到了则不创建否则进行创建!具体如下:
    查找子窗休是否存在函数:
    function checkMDIChildform(formname:string):boolean;
    //formname:为要创建的子窗体名称;
    var i:integer;
    begin
      result:=false;
      for i:=0 to mainFrm.MDIChildCount -1 do
      begin
    if uppercase(mainFrm.MDIChildren[i].Name)=uppercase(formname) then
    begin
      result:=true;
      break;
    end;
      end;
    end;procedure TMainFrm.N7Click(Sender: TObject);
    begin
    if checkMDIChildform('MaterialFrm') then
    MaterialFrm.WindowState:=wsMaximized
    else  MaterialFrm:=TMaterialFrm.Create(application);
    end;