Delphi and DPI 100% 125% 150% on Windows 7

emilio76
emilio76 used Ask the Experts™
on
Hey guys.

I am developing a Delphi product that I develop in 100% 96 dpi and when running the product on different dpi all my controls get messy and go out of the regular places and fonts in buttons, panels gets bigger and the product looks ugly. Is there a function / solution that can be set on each form.oncreate to encounter this and always display the product on each of the dpi settings in Windows as it was developed under?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Sinisa VukSoftware architect
Top Expert 2012

Commented:
Set each form property Scaled = False
Geert GOracle dba
Top Expert 2009

Commented:
up to now i have only ever found 1 good way.
develop a form for each dpi setting
alas this is so much work, that it isn't a very good financial/economical way

i haven't found a tool which does a 100% good job
Senior developer, analyst and customer assistance
Commented:
For a little app in the past I've used this method:

procedure TForm1.FormCreate(Sender: TObject);
begin
  self.Scaled := false;
  self.ScaleBy(Screen.PixelsPerInch, 96);
end;

where 96 is the DPI used on development
Ephraim WangoyaSoftware Engineer

Commented:
Create a master Form and let all the forms in your Application inherit from it.
In the master form, you can then add Ferruccio68's code as shown above

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial