桌面刷新的问题,我发现是用了LockWindowUpdate锁定窗口然后解锁引起桌面刷新的。
procedure TCnCustomLangManager.TranslateForm(AForm: TCustomForm);
begin
LockWindowUpdate(AForm.Handle);
try
if FUseDefaultFont and Assigned(FLanguageStorage) then
begin
with FLanguageStorage do
begin
if FontInited then
begin
{$IFDEF DEBUG}
CnDebugger.LogMsg('LangManager: FontInited. ');
{$ENDIF DEBUG}
if CurrentLanguageIndex <> -1 then
begin
AForm.Font.Name := DefaultFont.Name;
AForm.Font.Size := DefaultFont.Size;
AForm.Font.Charset := DefaultFont.Charset;
end;
end;
end;
end;
TranslateComponent(AForm, AForm.ClassName);
finally
LockWindowUpdate(0);
end;
end;