Board index » delphi » OnMouseIn & OnMouseOut

OnMouseIn & OnMouseOut

How to simulate OnMouseIn and OnMouseOut event with Delphi  ?
(these events are used in Javascript)

I want to simulate actions like in a a web page.

Thanks.

 

Re:OnMouseIn & OnMouseOut


How to simulate OnMouseIn and OnMouseOut event with Delphi  ?
(these events are used in Javascript)

I want to simulate actions like in a a web page.

Thanks.

Re:OnMouseIn & OnMouseOut


Quote
Twidi wrote:

> How to simulate OnMouseIn and OnMouseOut event with Delphi  ?
> (these events are used in Javascript)

   You need to capture the undocumented Delphi messages CM_MOUSEENTER
and CM_MOUSELEAVE. Capture them as you would capture normal Windows
messages.

--
Marko Peric     lonew...@tig.com.au

Re:OnMouseIn & OnMouseOut


Quote
On Sun, 19 Apr 1998 04:55:45 +0200, "Twidi" <tw...@club-internet.fr> wrote:
>How to simulate OnMouseIn and OnMouseOut event with Delphi  ?
>(these events are used in Javascript)

>I want to simulate actions like in a a web page.

>Thanks.

You need a component like this:

unit MImage;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, extctrls;

type
  TMImage = class(TImage)
  private
    FOnMouseEnter: TNotifyEvent;
    FOnMouseLeave: TNotifyEvent;
    procedure CMMouseEnter(var Msg: TMessage); message CM_MOUSEENTER;
    procedure CMMouseLeave(var Msg: TMessage); message CM_MOUSELEAVE;
  protected
  public
  published
    property OnMouseEnter: TNotifyEvent read FOnMouseEnter write FOnMouseEnter;
    property OnMouseLeave: TNotifyEvent read FOnMouseLeave write FOnMouseLeave;
end;

procedure Register;

implementation

procedure Register;
begin
  RegisterComponents('My Components', [TMImage]);
end;

procedure TMimage.CMMouseEnter(var Msg: TMessage);

begin
  if Assigned(FOnMouseEnter) then FOnMouseEnter(Self);
end;

procedure TMimage.CMMouseLeave(var Msg: TMessage);

begin
  if Assigned(FOnMouseLeave) then FOnMouseLeave(Self);
end;

end.

--

Ralph Hilton

Re:OnMouseIn & OnMouseOut


How to simulate OnMouseIn and OnMouseOut event with Delphi  ?
(these events are used in Javascript)

I want to simulate actions like in a a web page.

Thanks.

Re:OnMouseIn & OnMouseOut


Thanks a lot and excuse me for the triple message !

Other Threads