在delphi里面用mdi结构怎么判断其中的某个子窗体已经被创建啊?我用FindWindowEx()好像不行请大家指点下
以下是代码,请大家看看那里错了
(MainForm是主窗体,TMDIChild是子窗体)
if FindWindowEx(MainForm.Handle,0,0,'no1')=0 then
  begin
    Child := TMDIChild.Create(Application);
    Child.Caption := 'no1';
  end
else
................

解决方案 »

  1.   

    if Application.FindComponent('MDIChildFrm')=nil then
      Application.CreateForm(TMDIChildFrm,MDIChildFrm);
    MDIChildFrm.Caption:='nol';
      

  2.   

    begin
    IF  not  Assigned(TMDIChild) then 
    TMDIChild:= TTMDIChild.Create(self)
    else
    TMDIChild.Show ;
    end;
      

  3.   

    给你段代码:
      if not Assigned(frmStorageMain) then
      begin
        frmStorageMain:=TfrmStorageMain.Create(Application);
        frmStorageMain.Show;
      end
      else
        frmStorageMain.WindowState:=wsMaximized;
      

  4.   

    http://search.csdn.net/Expert/topic/1043/1043828.xml?temp=.8110773