F
fengxiaoxiao
Unregistered / Unconfirmed
GUEST, unregistred user!
代码如下:
type
TFengButton = class(TWinControl)
private
{ Private declarations }
FSpeedbutton:TSpeedbutton;
FEdit:Tedit;
function GetText: String;
procedure SetText(const Value: String);
function GetFont: TFont;
procedure SetFont(const Value: TFont);
protected
{ Protected declarations }
public
{ Public declarations }
constructor Create(AOwner:TComponent);override;
destructor Destroy;override;
published
{ Published declarations }
property Text:String read GetText write SetText;
property Font:TFont read GetFont write SetFont;
end;
constructor TFengButton.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
FEdit:=TEdit.Create(AOwner);
FEdit.Parent:=self;
Fedit.Height :=21;
FSpeedbutton:=TSpeedbutton.Create(self);
FSpeedbutton.Left :=Fedit.Width ;
FSpeedbutton.Height :=19;
FSpeedbutton.Width :=19;
FSpeedbutton.Caption :='...';
FSpeedbutton.Parent := self; //这句报错,错误信息:[Error] FengButton.pas(55): Incompatible types: 'TWidgetControl' and 'TSpeedButton'
width:=FEdit.Width +FSpeedbutton.Width ;
height:=FEdit.Height ;
end;
我不知道TWidgetControl到底是个什麽东西,请明白人指点一下.
type
TFengButton = class(TWinControl)
private
{ Private declarations }
FSpeedbutton:TSpeedbutton;
FEdit:Tedit;
function GetText: String;
procedure SetText(const Value: String);
function GetFont: TFont;
procedure SetFont(const Value: TFont);
protected
{ Protected declarations }
public
{ Public declarations }
constructor Create(AOwner:TComponent);override;
destructor Destroy;override;
published
{ Published declarations }
property Text:String read GetText write SetText;
property Font:TFont read GetFont write SetFont;
end;
constructor TFengButton.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
FEdit:=TEdit.Create(AOwner);
FEdit.Parent:=self;
Fedit.Height :=21;
FSpeedbutton:=TSpeedbutton.Create(self);
FSpeedbutton.Left :=Fedit.Width ;
FSpeedbutton.Height :=19;
FSpeedbutton.Width :=19;
FSpeedbutton.Caption :='...';
FSpeedbutton.Parent := self; //这句报错,错误信息:[Error] FengButton.pas(55): Incompatible types: 'TWidgetControl' and 'TSpeedButton'
width:=FEdit.Width +FSpeedbutton.Width ;
height:=FEdit.Height ;
end;
我不知道TWidgetControl到底是个什麽东西,请明白人指点一下.