unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Mask, DBCtrls;
type
TDBEdit=Class(DBCtrls.TDBEdit)
private
FOnMouseEnter: TNotifyEvent;
FOnMouseLeave: TNotifyEvent;
Protected
procedure CMMouseEnter(
var Message: TMessage);
message CM_MOUSEENTER;
procedure CMMouseLeave(
var Message: TMessage);
message CM_MOUSELEAVE;
Published
Property OnMouseEnter:TNotifyEvent
read FOnMouseEnter
Write FOnMouseEnter;
Property OnMouseLeave:TNotifyEvent
read FOnMouseLeave
Write FOnMouseLeave;
End;
TForm1 =
class(TForm)
ComboBox1: TComboBox;
DBEdit1: TDBEdit;
procedure FormCreate(Sender: TObject);
private
procedure MyMouseEnter(Sender: TObject);
procedure MyMouseLeave(Sender: TObject);
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
Dbedit1.OnMouseEnter := MyMouseenter;
Dbedit1.OnMouseLeave := MyMouseLeave;
end;
Procedure TForm1.MyMouseEnter(Sender:TObject);
begin
Caption := '
Enter';
end;
Procedure TForm1.MyMouseLeave(Sender:TObject);
begin
Caption := '
Leave';
end;
{ TDBEdit }
procedure TDBEdit.CMMouseEnter(
var Message: TMessage);
begin
if Assigned (FonMouseEnter)
then FOnMouseEnter(self);
inherited;
end;
procedure TDBEdit.CMMouseLeave(
var Message: TMessage);
begin
if Assigned (FonMouseEnter)
then FOnMouseLeave(self);
inherited;
end;
end.