C
Chen Yu
Unregistered / Unconfirmed
GUEST, unregistred user!
我打算做个控件,从PageControl下继承,想直接建立几个TabSheet,请问应该怎么做啊,
我加了 如下代码,却提示父类应该是个窗口,搞不明白了。。。。
type
tMyPage = class(TPageControl)
private
{ Private declarations }
protected
{ Protected declarations }
public
{ Public declarations }
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
published
{ Published declarations }
end;
-------------------------------------------
constructor tMyPage.Create(AOwner: TComponent);
var aa:ttabsheet;
begin
inherited create(aowner);
aa:= ttabsheet.create(self);
aa.PageControl := self;
aa.caption:='test';
end;
--------------------------------------------
错误提示是:" Control '' has no parent window "
哪位大侠帮着看看啊
我加了 如下代码,却提示父类应该是个窗口,搞不明白了。。。。
type
tMyPage = class(TPageControl)
private
{ Private declarations }
protected
{ Protected declarations }
public
{ Public declarations }
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
published
{ Published declarations }
end;
-------------------------------------------
constructor tMyPage.Create(AOwner: TComponent);
var aa:ttabsheet;
begin
inherited create(aowner);
aa:= ttabsheet.create(self);
aa.PageControl := self;
aa.caption:='test';
end;
--------------------------------------------
错误提示是:" Control '' has no parent window "
哪位大侠帮着看看啊