首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

问个简单的小疑点-关于窗体创建-大家来看看

2012-03-06 
问个简单的小问题-关于窗体创建----大家来看看创建一个FORM时loFindSitefrm:TFindSitefrm.Create(nil)lo

问个简单的小问题-关于窗体创建----大家来看看
创建一个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;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.
[解决办法]
http://blog.csdn.net/liuliu0103/article/details/6249900
[解决办法]
Application:你的控件的父级是主程序,所以他的级别最高.
Self:你的控件的父级是当前窗口,他关闭你也关闭.
Sender:你的控件的父级是当前对象.
Handle:你的控件的父级是此句柄.
Nil:无定义.生成的独立窗体需代码释放

热点排行