怎样确认某个窗子口是否已创建,怎样查找某个特定的窗口,多谢各位帮助,

解决方案 »

  1.   

    procedure TMainForm.N1Click(Sender: TObject);
    begin
    if self.FindComponent('FrmOperator')<>nil then
    begin
      FrmOperator.BringToFront;
      beep;
      exit;
    end else
    begin
      FrmOperator :=TFrmOperator.Create(Self);
      FrmOperator.show;
    end;
    end;
      

  2.   

    if not Assigned(Form1) then  //判別是否已創建
      

  3.   

    TO foxyy
      多谢你的回复,如果窗口的Name一样,但Caption不一样,又怎能样区别呢?
      

  4.   

    function TMainForm.ExistsForm(MDIFormCaption:String):boolean;
    var
      i:byte;
    begin
      result:=true;
      for i:=0 to MDIChildCount-1 do
      begin
        if MDIChildren[i].Caption=MDIFormCaption
        then result:=false;
      end;
    end;
      

  5.   

    一个工程没有两个窗口Name是一样的吧?