Delphi:创建一个表单&xAB;手工操作»;

Delphi:创建一个表单&xAB;手工操作»;,delphi,Delphi,我编写模块: unit Unit2; interface uses Forms; type TForm2 = class(TForm) end; implementation end. 在按钮OnClick处理程序中,我写入: with TForm2.Create(Self) do try ShowModal; finally Free; end; 按下按钮会引发异常: Resource TForm2 not found 有没有可能完全“手工”创建表单,而不涉及在资源中保存

我编写模块:

unit Unit2;
interface
uses Forms;
type
  TForm2 = class(TForm)
  end;
implementation
end.
在按钮OnClick处理程序中,我写入:

with TForm2.Create(Self) do
try
  ShowModal;
finally
  Free;
end;
按下按钮会引发异常:

Resource TForm2 not found

有没有可能完全“手工”创建表单,而不涉及在资源中保存表单属性的机制?

我自己也没有尝试过,但从我所读到的内容来看,有几种方法:

  • 不要从
    TForm
    继承,如中所示
  • 使用,如在