问个简单的小疑点-关于窗体创建-大家来看看
问个简单的小问题-关于窗体创建----大家来看看
创建一个FORM时
loFindSitefrm:=TFindSitefrm.Create(nil);
loFindSitefrm:=TFindSitefrm.Create(self);
loFindSitefrm:=TFindSitefrm.Create(Application);
它们的参数具体有什么区别呢?
nil seif application或者还有其它?
------解决方案--------------------
查看delphi帮助
创建一个FORM时
loFindSitefrm:=TFindSitefrm.Create(nil);
loFindSitefrm:=TFindSitefrm.Create(self);
loFindSitefrm:=TFindSitefrm.Create(Application);
它们的参数具体有什么区别呢?
nil seif application或者还有其它?
------解决方案--------------------
查看delphi帮助
- Delphi(Pascal) code
Creates and initializes a new TForm object. constructor Create(AOwner: TComponent); override; Description Use 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.
------解决方案--------------------
http://blog.****.net/liuliu0103/article/details/6249900
------解决方案--------------------
Application:你的控件的父级是主程序,所以他的级别最高.
Self:你的控件的父级是当前窗口,他关闭你也关闭.
Sender:你的控件的父级是当前对象.
Handle:你的控件的父级是此句柄.
Nil:无定义.生成的独立窗体需代码释放