这是一个例子,弄明白他的道理就可以了
unit Edit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TEdit1 = class(TEdit)
private
{ Private declarations }
FOnresizer : TNotifyEvent;
protected
{ Protected declarations }
procedure WmSize(var message : TMessage); message WM_Size;
public
{ Public declarations }
published
{ Published declarations }
property OnResize : TNotifyEvent read FOnresizer write Fonresizer;
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents('Samples', [TEdit1]);
end;
procedure Tedit1.WmSize(var message : TMessage);
begin
if Assigned(FOnresizer) then FOnresizer(Self);
end;
end.