R
red2000
Unregistered / Unconfirmed
GUEST, unregistred user!
我做了一个小组件源码如下:
// filename is CCSmallEdit.pas
unit CCSmallEdit;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TCCSmallEdit = class(TEdit)
private
{ Private declarations }
protected
{ Protected declarations }
public
{ Public declarations }
published
{ Published declarations }
constructor Create(AOwner:TComponent);
override;
end;
procedure Register;
implementation
constructor TCCSmallEdit.Create(AOwner:TComponent);
begin
inherited Create(AOwner);
Color := clBlue;
Font.Color := clYellow;
Font.Name := 'Times New Roman';
Font.Size := 12;
Font.Style := [fsBold];
end;
procedure Register;
begin
RegisterComponents('Sa', [TCCSmallEdit]);
end;
end.
然后 File->New->Package 生成Package1.dpk,再Add->Add Unit添加
CCSmallEdit.pas后在,Package1.dpk 的Contains下,有CCSmallEdit.pas
,CCSmallEdit.dcr两个文件,再Compile->Install完成后在Project Options
->Design Packages下选中Package1,选component时可以看见CCSmallEdit
但在工具栏上却没有?????????
// filename is CCSmallEdit.pas
unit CCSmallEdit;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TCCSmallEdit = class(TEdit)
private
{ Private declarations }
protected
{ Protected declarations }
public
{ Public declarations }
published
{ Published declarations }
constructor Create(AOwner:TComponent);
override;
end;
procedure Register;
implementation
constructor TCCSmallEdit.Create(AOwner:TComponent);
begin
inherited Create(AOwner);
Color := clBlue;
Font.Color := clYellow;
Font.Name := 'Times New Roman';
Font.Size := 12;
Font.Style := [fsBold];
end;
procedure Register;
begin
RegisterComponents('Sa', [TCCSmallEdit]);
end;
end.
然后 File->New->Package 生成Package1.dpk,再Add->Add Unit添加
CCSmallEdit.pas后在,Package1.dpk 的Contains下,有CCSmallEdit.pas
,CCSmallEdit.dcr两个文件,再Compile->Install完成后在Project Options
->Design Packages下选中Package1,选component时可以看见CCSmallEdit
但在工具栏上却没有?????????