Board index » delphi » OnMouseOver, OnMouseOut, OnMouseInn

OnMouseOver, OnMouseOut, OnMouseInn

Im missing thise event in Delphi 3. is the OnMouseMove a replacement for
all the above?
How can i then detekts a onmouseout? the way i see it if i whant text in the
statusbar i need to have a onmousemove..:='Hello!' on the button and
OnMouseMove..:='' on the Form or Panel that the button is on.

Am i missing somthing?..i meen what am i missing..

Svenna
sve...@{*word*104}gal.com
http://home.sol.no/~svenive/

 

Re:OnMouseOver, OnMouseOut, OnMouseInn


Svenna,

Create a new component that descends from TButton, and override
the CM_MOUSEENTER and CM_MOUSEEXIT events.

Ken
--
Ken White
kwh...@westelcom.com

Clipper Functions for Delphi
http://members.aol.com/clipfunc/

Quote
Svenna wrote:

> Im missing thise event in Delphi 3. is the OnMouseMove a replacement for
> all the above?
> How can i then detekts a onmouseout? the way i see it if i whant text in the
> statusbar i need to have a onmousemove..:='Hello!' on the button and
> OnMouseMove..:='' on the Form or Panel that the button is on.

> Am i missing somthing?..i meen what am i missing..

> Svenna
> sve...@{*word*104}gal.com
> http://home.sol.no/~svenive/

Re:OnMouseOver, OnMouseOut, OnMouseInn


Quote
>Create a new component that descends from TButton, and override
>the CM_MOUSEENTER and CM_MOUSEEXIT events.

OK..but i have no ide on making components :)

Svenna
sve...@{*word*104}gal.com
http://home.sol.no/~svenive/

Re:OnMouseOver, OnMouseOut, OnMouseInn


Svenna,

Here you go - of course, you'll want to actually do something
better in the CM_MOUSEENTER and CM_MOUSELEAVE handlers... <g>

Also, note the mistake in my last post - the message for the
mouse leaving the control is CM_MOUSELEAVE, not CM_MOUSEEXIT...

(************ CODE BEGINS *******************)
unit MyButton;

interface

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

type
  TMyButton = class(TButton)
  private
    { Private declarations }
  protected
    procedure CMMouseEnter( var Msg: TMessage); message
         CM_MOUSEENTER;
    procedure CMMouseLeave(var Msg: TMessage); message
         CM_MOUSELEAVE;
    { Protected declarations }
  public
    { Public declarations }
  published
    { Published declarations }
  end;

procedure Register;

implementation

procedure TMyButton.CMMouseEnter(var Msg: TMessage);
begin
     Self.Caption := 'Just got here';
end;

procedure TMyButton.CMMouseLeave(var Msg: TMessage);
begin
    Self.Caption := 'Just left';
end;

procedure Register;
begin
  RegisterComponents('Test Stuff', [TMyButton]);
end;

end.
(************* CODE ENDS ******************)

HTH

Ken
--
Ken White
kwh...@westelcom.com

Clipper Functions for Delphi
http://members.aol.com/clipfunc/

Quote
Svenna wrote:

> >Create a new component that descends from TButton, and override
> >the CM_MOUSEENTER and CM_MOUSEEXIT events.
> OK..but i have no ide on making components :)

> Svenna
> sve...@{*word*104}gal.com
> http://home.sol.no/~svenive/

Other Threads