o,你是想当用户输入或改变text时触发你自己定义的类的onchange?
type
mypanel=class(TCustomPanel)
...
private
FOnChange: TNotifyEvent;
FEdit:TEdit;
EditChange:TNotifyEvent;
published
property OnChange: TNotifyEvent read FOnChange write FOnChange;
.....
public
constructor Create(AOwner: TComponent); override;
..........
constructor TMyPanel.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
FEdit.Create(Self);
FEdit.Parent:=self;
......
FEdit.OnChange:=EditChange;
...
end;
Procedure TMyPanel.EditChange(Sender:TObject);
begin
....
if Assigned(FOnchange) then FOnChange(Self);
...
end;
.............