给你一个
unit Panelt;
interface
uses
Windows, Messages, SysUtils, Classes, Controls, ExtCtrls, Buttons;
type
TPanelt = class(TPanel)
private
FButton: TSpeedButton;
protected
{ Protected declarations }
public
{ Public declarations }
constructor Create(AOwner: TComponent);override;
destructor Destroy;override;
published
{ Published declarations }
property Button: TSpeedButton read FButton;
end;
procedure Register;
implementation
constructor TPanelt.Create(AOwner: TComponent);
begin
inherited;
FButton := TSpeedButton.Create(self);
FButton.Parent := self;
FButton.Name := 'FButton';
FButton.SetSubComponent(true);
FButton.Top := 10;
FButton.Left := 10;
FButton.Show;
end;
destructor TPanelt.Destroy;
begin
FButton.Free;
inherited;
end;
procedure Register;
begin
RegisterComponents('dwh', [TPanelt]);
end;
end.