怎样判断一个窗体已经创建了?
给出代码啊!

解决方案 »

  1.   

    帮助上的var P: Pointer;begin
      P := nil;
      if Assigned (P) then Writeln ('You won''t see this');
      GetMem(P, 1024); {P valid}
      FreeMem(P, 1024); {P no longer valid and still not nil}
      if Assigned (P) then Writeln ('You''ll see this');
    end;
      

  2.   

    if Not Assigned(Form2) then Application.CreateForm(TForm2,Form2) 
    Form2.Show ;
      

  3.   

    if Not Assigned(Form2) then Application.CreateForm(TForm2,Form2) ;
    Form2.Show ;