看看控件的Focused是否为true,遍历所有控件就可以了,下面是Delphi帮助中的示例:
procedure TForm1.ColorControl(Sender: TObject);
var
  I : Integer;
  ControlColor: TColor;
begin
  for I:= 0 to ControlCount -1 do  begin
    ControlColor :=clNormalForeground;
    if Controls[I] is TWidgetControl then
      if (Controls[I] as TWidgetControl).Focused then
        ControlColor := clRed
    if Controls[I] is TEdit then
      (Controls[I] as TEdit).Color := ControlColor
    elseif Controls[I] is TMemo then
      (Controls[I] as TMemo).Color := ControlColor
    elseif Controls[I] is TButton then
      (Controls[I] as TButton).Font.Color := ControlColor;
  end;
end;procedure TForm1.FormCreate(Sender: TObject);
begin
  Screen.OnActiveControlChange := ColorControl;
end;