Standard behavior would be to use default OS Dialog font.
To overcome this, in each form's OnCreate event, invoke the following procedure:
procedure SetFormFontToSystemDefaultFont(Form: TForm);
var
NonClientMetrics: TNonClientMetrics;
begin
NonClientMetrics.cbSize := SizeOf(NonClientMetrics);
SystemParametersInfo(SPI_GETNONCLIENTMETRICS, 0, @NonClientMetrics, 0);
Form.Font.Handle := CreateFontIndirect(NonClientMetrics.lfMessageFont);
if Form.Scaled then
begin
Form.Font.Height := NonClientMetrics.lfMessageFont.lfHeight;
end;
end;
(Set ParentFont property to True for all controls on the Form for this to have effect).
No comments:
Post a Comment