如果已经创建,让它SHOW即可!

解决方案 »

  1.   

    名字怎么可能一样,在VB里如果名字一样也要建立数组的
    name.show
    setActiveWindow(name.handle);
      

  2.   

    我是这样创建的
    procedure TFrmMain.FrmCreate(Caption : string);
    var
      FView : TChildFrm;
    begin
      FView := TChildFrm.Create(self); 
      FView.Caption := Caption;   
      FView.Show;
    end;
      

  3.   

    to myxfang(小方) 
      这种方法我试过,这好象是以字窗体的Z轴排序,不是以创建先后循序排序
      

  4.   

    定义成控件数组,而且要是全局的。
    var MDIFrm : array[0..9] of TChiedFrm;
    再定义一个全局的整型变量 MDICount 记录当前生成的子窗体个数。
      

  5.   

    procedure ShowChild(ACaption: string);
      function GetChildFormByCaption: TForm;
      var
        I: Integer;
      begin
        for I := 0 to CompnentCount - 1 do
          if Components[I] is TForm and (TForm(Components[I]).Caption = ACaption) then
          begin
            Resut ;= TForm(Components[I]);
            Exit;  
          end;
      end;
    var
      ChildForm: TForm;
    begin
      ChildForm := GetChildFormByName;
      if ChildForm <> nil then
         ChildForm.Show else
         ShowMessage('没有Caption为:'+ACaption+'的子窗')
    end;
      

  6.   

    自已写个函数通过子窗体的Caption进行查找显示!
    procedure TFrmMain.FindShowFrm(aCaption : string);
    var
      i:integer;
    begin
      for i:=0 to MDIChildCount-1 do
      begin
        if MDIChildren[i].caption=aCaption then 
        begin
          MDIChildren[i].Show;
          break;
        end;
      end;
    end;