D
DiamondKing
Unregistered / Unconfirmed
GUEST, unregistred user!
我想设计一个由Edit,和Button组合起来的组件,自定义组件名称为TMyButtonEdit ,从TWincontrol 继承下来,
则组件的构造函数有如下代码:
Constructor TMyButtonEdit.Create (AOwner,TComponent);
begin
inherited Create(AOwner);
FEdit:=TEdit.Create(Self);
FEdit.Parent:=Self; //****
FEdit.Height:=21;
.........
end;
****行出错,提示为类型不匹配!
[Error] MyButtonEdit.pas(46): Incompatible types: 'TWidgetControl' and 'TButtonEdit'
如何在创建TMyButtonEdit时,在MybuttonEdit上画出FEdit?
则组件的构造函数有如下代码:
Constructor TMyButtonEdit.Create (AOwner,TComponent);
begin
inherited Create(AOwner);
FEdit:=TEdit.Create(Self);
FEdit.Parent:=Self; //****
FEdit.Height:=21;
.........
end;
****行出错,提示为类型不匹配!
[Error] MyButtonEdit.pas(46): Incompatible types: 'TWidgetControl' and 'TButtonEdit'
如何在创建TMyButtonEdit时,在MybuttonEdit上画出FEdit?