Large fonts (120 DPI) mess up my screen lay-out

My Application is designed in Normal Size (96 DPI). When it is run under f.e. Large Size(120 DPI) some controls aren't scaled correctly and some fall behind other controls.
How can I make sure my application runs under 96 DPI, can I somehow set this up only within my application?
Please supply me with some sample code.
Stef MerlijnDeveloperAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

SteveBayCommented:
Have you checked the "Scaled" property?

It's explained well here:
http://www.prestwood.com/aspsuite/kb/document_view.asp?qid=100255
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Stef MerlijnDeveloperAuthor Commented:
I've tried to set scaled to False and PixelsPerInch to 96 in the Oncreate-event of the form, but is still gets resized to the large fonts. Do you have any other ideas?
0
diniludCommented:
constructor TForm1.Create(AOwner: TComponent);
begin
   inherited Create(AOwner);
   ParentFont:=False;
   Font.Height:=13;
   PixelsPerInch:=96;
end;
0
Stef MerlijnDeveloperAuthor Commented:
Found this solution that works as expected. This code must be added to all forms. The font must be something like Arial (True Font Type).

You must also set:
Form1.Scaled := True
procedure TForm1.FormCreate(Sender: TObject);
begin   
  if Screen.PixelsPerInch <> PixelsPerInch then
  begin     
    ScaleBy(Screen.PixelsPerInch, PixelsPerInch);   
  end; 
end;

Open in new window

0
Stef MerlijnDeveloperAuthor Commented:
Thanks for pointing me in the right direction.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.