if not assigned(form) then
begin
    form := TForm.create(self);
end;

解决方案 »

  1.   

    if Form1=nil then 没有创建
    if Form1.Showing then 是显示
      

  2.   

    form.showing   //是否显示
      

  3.   

    zfmich()的做法可以,但要注意form不能是局部变量,比如以下例子不能满足要求
    procedure TForm1.Button1Click(Sender: TObject);
    var form: Tform2;
    begin
     if not assigned(form) then
     begin
     form:=tform2.Create(self);
     form.Show();
     end;
    end;
      

  4.   

    if (AForm = nil) or (not AForm.HandleAlloced) then 
      AForm := TForm.Create(Application);if not AForm.Showing then AForm.Show;if (AForm <> nil) and  (AForm.HandleAlloced) then FreeAndNil(AForm);
      

  5.   

    if findwindow('Tform','formname')<>null then
    已create 或者show
    else
     没有