Hello friends.
I created a class that when the TEdit, TLabeledEdit and TMaskEdit , is focused, the color changes.
TEdit and TLabeledEdit changes the color. ok.
TMaskedit doesn't change the color.
unit uChangeColorEdit;
{$mode ObjFPC}{$H+}
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls, StdCtrls,
LMessages, LCLIntf, EditBtn, MaskEdit, rxcurredit;
type
{ TEdit }
TEdit = Class(StdCtrls.TEdit)
private
FOldColor : TColor;
protected
procedure DoEnter; override;
procedure DoExit; override;
end;
{ TLabeledEdit }
TLabeledEdit = Class(ExtCtrls.TLabeledEdit)
private
FOldColor : TColor;
protected
procedure DoEnter; override;
procedure DoExit; override;
end;
{ TMaskEdit }
TMaskEdit = Class(MaskEdit.TMaskEdit)
private
FOldColor : TColor;
protected
procedure DoEnter; override;
procedure DoExit; override;
end;
implementation
{ TMaskEdit }
procedure TMaskEdit.DoEnter;
begin
inherited DoEnter;
FOldColor := Color;
Color := clYellow;
end;
procedure TMaskEdit.DoExit;
begin
inherited DoExit;
Color := FOldColor;
end;
{ TLabeledEdit }
procedure TLabeledEdit.DoEnter;
begin
inherited DoEnter;
FOldColor := Color;
Color := clYellow;
end;
procedure TLabeledEdit.DoExit;
begin
inherited DoExit;
Color := FOldColor;
end;
{ TEdit }
procedure TEdit.DoEnter;
begin
inherited DoEnter;
FOldColor := Color;
Color := clYellow;
end;
procedure TEdit.DoExit;
begin
inherited DoExit;
Color := FOldColor;
end;
end.