Thema: Delphi onMouseMove abfragen?

Einzelnen Beitrag anzeigen

Benutzerbild von Gausi
Gausi

Registriert seit: 17. Jul 2005
877 Beiträge
 
Delphi 11 Alexandria
 
#19

Re: onMouseMove abfragen?

  Alt 29. Mai 2007, 16:22
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.
  Mit Zitat antworten Zitat