1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
| Procedure TmaForm.FormCreate(Sender : TObject);
begin
ParcourslistComp(self);
end;
procedure TmaForm.ParcourslistComp(F: TScrollingWinControl);
var
i: integer;
c: TComponent;
begin
for i := 0 to Pred(F.ComponentCount [EDit ] suppression "-1" [/EDIT]) do
begin
c := F.Components[i];
AssignPropriete(c);
end;
end;
procedure TmaForm.AssignPropriete(C: TComponent);
begin
if (C is TEdit) then
begin
if not Assigned(TEdit(C).OnEnter) then
TEdit(C).OnEnter := OnEnterControl;
if not Assigned(TEdit(C).OnExit) then
TEdit(C).OnExit := OnExitControl;
end;
end;
{------------------------------------------------------------------------------}
procedure TmaForm.OnEnterControl(Sender: TObject);
begin
[EDit ] suppression [/EDIT]
if (Sender is TEdit) then
(Sender as TEdit).Color := clLightYellow;
nd;
{------------------------------------------------------------------------------}
procedure TmaForm.OnExitControl(Sender: TObject);
begin
if (Sender is TEdit) then
(Sender as TEdit).Color := clWindow;
nd;
{------------------------------------------------------------------------------} |