我自己的一个函数,可以创建窗体或打开一创建的窗体:procedure OpenForm(FormClass: TFormClass; var fm; AOwner:TComponent);
var i: integer;
  Child:TForm;
begin  for i := 0 to Screen.FormCount -1 do
  BEGIN      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_RESTORE);
        if (not Child.Visible) then Child.Visible:=True;
        Child.BringToFront;
        Child.Setfocus;
        TForm(fm):=Child;
        exit;
      end;
  END;   //for end    Child:=TForm(FormClass.NewInstance);
    TForm(fm):=Child;
    child.Create(AOwner);关闭窗体:在窗体的close 事件中加入:
action:=cafree;