TEdit Interposer Class Property in VCL

Viewed 104

my "useless" Interposer class for TEdit :

  TEdit = class(Vcl.StdCtrls.TEdit)
    private
      FCheckValid : boolean;
      procedure GetLength;
    published
      property CheckValid : boolean read FCheckValid write FCheckValid;
  end;

and it's only procedure :

procedure TEdit.GetLength;
var
  aTask : ITask;
begin
  if Length(Self.Text) = 0 then
  begin


    aTask := TTask.Create(
      procedure
      begin
        TThread.Synchronize(TThread.Current,
          procedure
          begin
            Self.Color:=clYellow;
          end);

        Sleep(100);

        TThread.Synchronize(TThread.Current,
          procedure
          begin
            Self.Color:=clWhite;
          end);
      end
    );
    aTask.Start;

  end;
end;

Just for the sake of having fun . Is it somehow possible at all to make the VCL show the Property CheckValid for newly dropped TEdit Controls on the Form?

Thank you

0 Answers
Related