//一般写法 var MyForm1: TForm1; begin MyForm1 := TForm1.Create(nil); MyForm1.ShowModal; MyForm1.Free; end;
//用 with 语句重写 with TForm1.Create(nil) do begin ShowModal; Free; end;
//一般写法 var MyForm1: TForm1; begin MyForm1 := TForm1.Create(nil); MyForm1.ShowModal; MyForm1.Free; end;
//用 with 语句重写 with TForm1.Create(nil) do begin ShowModal; Free; end;