unit MyDBEDIT;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, Mask, DBCtrls;
type
TMyDBEDIT = class(TDBEDIT)
private
FFocusColor: TColor;
FColor:TColor;
procedure SetFocusColor(const Value: TColor);
procedure CurEnter(var msg:TCMENTER);message cm_enter;
procedure CurEnter(var msg:TCMleave);message cm_leave;
{ Private declarations }
protected
{ Protected declarations }
public
{ Public declarations }
published
{ Published declarations }
property FocusColor:TColor read FFocusColor write SetFocusColor;
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents('Samples', [TMyDBEDIT]);
end;
{ TMyDBEDIT }
procedure TMyDBEDIT.CurEnter(var msg: TCMENTER);
begin
FColor:=Color;
Color:=FFocusColor;
end;
procedure TMyDBEDIT.CurEnter(var msg: TCMleave);
begin
Color:=FColor;
end;
procedure TMyDBEDIT.SetFocusColor(const Value: TColor);
begin
FFocusColor := Value;
end;
end.