unit Unit1;
interface
uses
Messages, SysUtils, Graphics, Controls, Forms, ExtCtrls, Classes;
type
TPanel = class(ExtCtrls.TPanel)
private
procedure CMMouseEnter(var Message: TMessage);
message CM_MOUSEENTER;
procedure CMMouseLeave(var Message: TMessage);
message CM_MOUSELEAVE;
end;
type
TForm1 = class(TForm)
Panel1: TPanel;
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TPanel.CMMouseEnter(var Message: TMessage);
begin
inherited;
self.Color := clred;
end;
procedure TPanel.CMMouseLeave(var Message: TMessage);
begin
inherited;
self.Color := clblue;
end;
end.