创建form时如何传入参数?(100分)

W

wpw72

Unregistered / Unconfirmed
GUEST, unregistred user!
在创建from 时如传入参数'A',form.lbl1.caption 为'A',创建时传入参数'B',form.lbl1.caption 为'B',也即创建form时如何传入参数,constructor Create方法如何应用?
 
自己写一个初始化函数
constructor CreateWithCaption(Owner: TComponent;ACaption:String);
实现部分
constructor CreateWithCaption(Owner: TComponent;ACaption:String);
begin
inherited Create(Owner);
Self.Caption := ACaption;
end;
 
接受答案了.
 
我原来一直没搞定是因为该forme放在自动创建里了。
 
顶部