创建一个FORM时
loFindSitefrm:=TFindSitefrm.Create(nil);
loFindSitefrm:=TFindSitefrm.Create(self);
loFindSitefrm:=TFindSitefrm.Create(Application);
它们的参数具体有什么区别呢?
nil seif application或者还有其它?

解决方案 »

  1.   

    查看delphi帮助
    Creates and initializes a new TForm object.constructor Create(AOwner: TComponent); override;DescriptionUse Create to instantiate a TForm object or descendant of TForm at runtime. AOwner is the owner of the TCustomForm object.For descendants of TCustomForm that are not TForm objects, use CreateNew instead.  Calling Create for a TCustomForm descendant that is not a TForm will raise an exception.创建并初始化一个新的TForm对象。构造函数创建(AOwner:TComponent);覆盖;说明使用创建实例化一个TForm对象或在运行时TForm的后代。 AOwner是TCustomForm的对象的所有者。TCustomForm的后裔,是不是TForm对象,而不是使用CreateNew。调用创建一个TCustomForm的后裔,是不是一个TForm,将引发异常。
      

  2.   

    http://blog.csdn.net/liuliu0103/article/details/6249900
      

  3.   

    Application:你的控件的父级是主程序,所以他的级别最高.
    Self:你的控件的父级是当前窗口,他关闭你也关闭.
    Sender:你的控件的父级是当前对象.
    Handle:你的控件的父级是此句柄.
    Nil:无定义.生成的独立窗体需代码释放