![]() |
| |
Be sure to have an open door to leave.
|
Published in Delphi3000.com I don't know what is wrong with mouse leave event that makes Borland not to support it in Delphi controls. Bellow is a small and easy to follow example of how to implement this event in TImage control. Also this example shows how to build a simple Delphi component. If you are new in Delphi programming please see the following notes:
unit MyImg;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
ExtCtrls;
type
TMyImage = class(TImage)
private
FOnMouseLeave: TNotifyEvent;
procedure CMMouseLeave(var Message: TMessage); message CM_MOUSELEAVE;
protected
public
published
property OnMouseLeave: TNotifyEvent read FOnMouseLeave write FOnMouseLeave;
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents('Samples', [TMyImage]);
end;
procedure TMyImage.CMMouseLeave(var Message: TMessage);
begin
inherited;
if Assigned(FOnMouseLeave) then FOnMouseLeave(Self);
end;
end.
|
Shagrouni 2001 Khaled Shagrouni khaled@shagrouni.com