procedure TWinControl.CMEnter(var Message: TCMEnter);
begin
if SysLocale.MiddleEast then
if UseRightToLeftReading then
begin
if Application.BiDiKeyboard <> '' then
LoadKeyboardLayout(PChar(Application.BiDiKeyboard), KLF_ACTIVATE);
end
else
if Application.NonBiDiKeyboard <> '' then
LoadKeyboardLayout(PChar(Application.NonBiDiKeyboard), KLF_ACTIVATE);
DoEnter;
end;
这是WinControl 的代码
不过你说的跟本用这着这么多
继承一个TEdit. 在OnEnter里写 Self.Font.Color := clRed;
在OnExit 里写Self.Font.Color := clBlack
够了!给钱。