在每个Form的FormCreate事件里调用SetComponentFont(self, GB2312_CHARSET, '宋体', 9);
type
TControlHack=class(TControl);
procedure SetComponentFont(Component: TComponent; charset: TFontCharset; fontname: string; fontsize: integer);
var
i: integer;
begin
if (Component is TControl) then
begin
TControlHack(Component).font.Charset:=charset;
TControlHack(Component).font.name:=fontname;
TControlHack(Component).font.size:=fontsize;
end;
for i:=0 to Component.ComponentCount-1 do
if (Component.Components is TControl) then
begin
TControlHack(Component.Components).font.Charset:=charset;
TControlHack(Component.Components).font.name:=fontname;
TControlHack(Component.Components).font.size:=fontsize;
end;
end;