Para el que dice que el clWindow no existe, basta con agregar en el uses la unit "Graphics"
Y con ese código que pones se puede hacer mucho más... por ejemplo:
En la declaración del objeto de la forma...
Código Delphi
[-]
procedure EnterControl(Sender: TObject);
procedure ExitControl(Sender: TObject);
Código Delphi
[-]
procedure TForm1.EnterControl(Sender: TObject);
begin
if Sender is TWinControl then
TWinControl(Sender).Color := clYellow;
end;
Código Delphi
[-]
procedure TForm1.ExitControl(Sender: TObject);
begin
if Sender is TWinControl then
TWinControl(Sender).Color := clWindow;
end;
y en el OnCreate de la Forma...
Código Delphi
[-]
for i:= 0 to ComponentCount - 1 do
begin
if (Components[i] is TEdit) then
begin
TEdit(Components[i]).OnEnter:= EnterControl;
TEdit(Components[i]).OnExit:= ExitControl;
end
else if (Components[i] is TDBEdit) then
begin
TDBEdit(Components[i]).OnEnter:= EnterControl;
TDBEdit(Components[i]).OnExit:= ExitControl;
end;
end;
Sorry... es que ando aburrido y necesitaba escribir...
Saludos