Ich meinte hlat sowas in der Art:
Delphi-Quellcode:
unit Mousepanel;
interface
uses
Messages, SysUtils, Classes, Controls, ExtCtrls;
type
tMousepanel =
class(TPanel)
private
{ Private-Deklarationen }
FOnMouseEnter: TNotifyEvent;
FOnMouseLeave: TNotifyEvent;
procedure CMMouseEnter(
var Message: TMessage);
message CM_MOUSEENTER;
procedure CMMouseLeave(
var Message: TMessage);
message CM_MOUSELEAVE;
protected
{ Protected-Deklarationen }
public
{ Public-Deklarationen }
published
{ Published-Deklarationen }
property OnMouseEnter: TNotifyEvent
read FOnMouseEnter
write FOnMouseEnter;
property OnMouseLeave: TNotifyEvent
read FOnMouseLeave
write FOnMouseLeave;
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents('
Beispiele', [tMousepanel]);
end;
procedure tMousepanel.CMMouseEnter(
var Message: TMessage);
begin
if assigned(FOnMouseEnter)
then FOnMouseEnter(Self);
end;
procedure tMousepanel.CMMouseLeave(
var Message: TMessage);
begin
if assigned(FOnMouseLeave)
then FOnMouseLeave(Self);
end;
end.