Hi,
 

Even on my computer, that has a slightly bigger standard font on
Windows, most forms from the IDE look bad.


I also remark this problem with my application,  only with Windows big font, all the testing I do with Gtk at different screen resolution do not show this problem.

I solve by calling this function after form.create :

scale := Screen.PixelsPerInch / myform.PixelsPerInch
{$ifdef win32}ScaleForm(myform,scale); {$endif}
procedure ScaleForm(form: TForm; scale: single);
var
i: integer;
begin

if abs(1-scale)>0.1 then // do not scale for 10%
with form do begin
width := round( width * scale );
height := round( height * scale );
for i := 0 to ComponentCount-1 do begin
if ( Components[i] is TControl ) then with (Components[i] as TControl) do begin
width := round( width * scale );
height := round( height * scale );
top := round( top * scale );
left := round( left * scale );
end;
end;
end;
end;

Maybe this can be implemented in TCustomForm ? but this is outside of my competence.
If I remember Delphi as a TForm.Scaled property that do something like that.

Patrick



Reply via email to