tags:

views:

366

answers:

3

I've got a Delphi 7 app, on the WinXP development machine the form size is the same as it was designed.

However, running the app on a Vista machine, some forms have been enlarged 20-30%, leaving big blank spaces on the right and bottom edge of forms.

On one of our client's WinXP machine, the forms have shrink, causing scroll bars to show up on the forms.

On most other machines, it shows up OK.

The app does remember the form size that was last used on some forms, and uses it next time the form is opened, however even removing these settings, the default form size is still different to how it was designed.

Any ideas?

+1  A: 

Large Fonts versus Small Fonts on the Vista machine maybe?

Tim Jarvis
+8  A: 

This sounds like a well known issue with Delphi forms and interactions with system font sizes.

The default behaviour of a Delphi form is to attempt to scale to respect the (runtime) user's desktop environment. This can have unintended and undesirable side effects however, and your "symptoms" sound like this could be what's going on in your case.

But all is not lost! The Scaled property (TRUE by default) can be set FALSE to prevent this, but I recommend you read that first article, and also consider The information in this article in order to determine whether this is the right solution in your case.

Deltics
Thanks, the problem was the client used Large Size in display (120dpi vs normal 96dpi)
Robo
A: 

Use this code in OnCreate event for every your form:

if Win32Platform = VER_PLATFORM_WIN32_NT then Font.Name := 'MS Shell Dlg 2' else Font.Name := 'MS Shell Dlg';