骆
骆璇
Unregistered / Unconfirmed
GUEST, unregistred user!
unit mybtn;
interface
uses
Windows, Messages, SysUtils, Classes, Controls, ExtCtrls,
buttons,stdctrls;
type
Tmyedit= class(TWinControl)
private
FMyBtn:TSpeedButton;
vmybtn:tspeedbutton;
FMyEdit:TEdit;
vmyedit:tedit;
public
constructor Create(AOwner:TComponent);override;
destructor destroy;override;
published
property Button:TSpeedButton read Fmybtn;
property Edit:TEdit read Fmyedit;
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents('samples', [Tmyedit]);
end;
constructor TMyEdit.Create(AOwner:TComponent);
begin
inherited ;
FMyBtn:=TSpeedButton.Create(nil);
FMyedit:=TEdit.Create(nil);
FMyEdit.Left:=0;
FMyEdit.Top:=0;
FMyEdit.Height:=30;
FMyEdit.Width:=150;
FMyBtn.Left :=151;
FMyBtn.Top:=0;
FMyBtn.Height:=30;
FMyBtn.Width:=30;
end;
destructor Tmyedit.destroy;
begin
fmybtn.Free;
fmyedit.Free;
end;
end.
运行正确,但为何不能显示button和edit?
interface
uses
Windows, Messages, SysUtils, Classes, Controls, ExtCtrls,
buttons,stdctrls;
type
Tmyedit= class(TWinControl)
private
FMyBtn:TSpeedButton;
vmybtn:tspeedbutton;
FMyEdit:TEdit;
vmyedit:tedit;
public
constructor Create(AOwner:TComponent);override;
destructor destroy;override;
published
property Button:TSpeedButton read Fmybtn;
property Edit:TEdit read Fmyedit;
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents('samples', [Tmyedit]);
end;
constructor TMyEdit.Create(AOwner:TComponent);
begin
inherited ;
FMyBtn:=TSpeedButton.Create(nil);
FMyedit:=TEdit.Create(nil);
FMyEdit.Left:=0;
FMyEdit.Top:=0;
FMyEdit.Height:=30;
FMyEdit.Width:=150;
FMyBtn.Left :=151;
FMyBtn.Top:=0;
FMyBtn.Height:=30;
FMyBtn.Width:=30;
end;
destructor Tmyedit.destroy;
begin
fmybtn.Free;
fmyedit.Free;
end;
end.
运行正确,但为何不能显示button和edit?