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/