按上面的方法,也可以这样。
unit Unit1;
interface
uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, Buttons, StdCtrls;
type TSpeedButton = class(TButton) public constructor Create(Aowner: TComponent); override; end;
TForm1 = class(TForm) SpeedButton1: TSpeedButton; private { Private declarations } public { Public declarations } end;
var Form1: TForm1;
implementation
{$R *.dfm}
{ TSpeedButton }
constructor TSpeedButton.Create(Aowner: TComponent); begin inherited Create(AOwner); Caption := 'TSpeedButton to TButton'; end;
end. |