Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5988063
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T22:54:22+00:00 2026-05-22T22:54:22+00:00

I have an application written in Delphi 6 and compiled on Windows XP. Usually

  • 0

I have an application written in Delphi 6 and compiled on Windows XP. Usually I leave 8px free between controls and the edges of forms.

When this app runs on Vista or Win 7 this gap is smaller or not present at all. I think this might be because these versions of Windows have thicker form borders.

Now I am moving the app to Delphi 2007. In the form designer the forms have lost the bottom and right gaps.

How should I deal with this? I have hundreds of forms and don’t want to go changing them all. Also, most of our users run the app on Win XP so I don’t want to make it look bad in XP.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T22:54:23+00:00Added an answer on May 22, 2026 at 10:54 pm

    Short version: change all form’s to AutoScroll = False


    The problem is the form’s AutoScroll property, and how it affects which form size is stored in the DFM.

    If AutoScroll is true (the default) the DFM will store Width and Height:

    object Form1: TForm1
      Left = 192
      Top = 114
      Width = 544
      Height = 375
      Caption = 'Form1'
      ...
    

    If AutoScroll is false (the preferred setting) the DFM will store ClientWidth and ClientHeight:

    object frmSplash: TfrmSplash
      Left = 192
      Top = 114
      ClientWidth = 536
      ClientHeight = 348
      Caption = 'Form1'
    

    The problem with storing Height is what happens when the user’s caption bar is a different size than your development machine, e.g.

    • you develop on Windows 2000, program runs on Windows XP
    • you develop on Windows XP, program runs on Windows Vista
    • you develop with small fonts, program runs with large fonts

    Windows 2000 had a 4 pixel border, with a 23 pixel caption bar. With the DFM storing a Height of 375, this leaves 348px for form client area.

    Run the same program on Windows XP, which has a taller (28 pixel) caption bar. With the DFM storing a Height of 375 pixels, this leaves 343px for client area.

    Your form “got 5 pixels shorter”.

    You need to force Delphi to store the ClientWidth and ClientHeight in the DFM by turning AutoScroll off.

    Now when you create your 348px tall form on Windows XP, it will continue to have 348 pixels in the client area – and be however extra tall is required to have a caption bar.

    i go so far as to have an OutputDebugString and a breakpoint trigger if my helper library code finds any form that mistakenly has AutoScroll set to true.


    Edit: Since i try to be a good developer, i make my form’s respect the user’s font preference. During the OnCreate of all my forms i call a StandardizeForm(Self) function that:

    • scales the form to match the user’s default font size
    • changes the font on all controls on the form to the user’s preference
    • issues an ODS if the form is set mistakenly set to Scaled
    • issues an ODS and breakpoint if AutoScroll true (and sets it to false)
    • issues an ODS and breakpoint if ShowHint is false (and turns it on)
    • etc

    You can do something similar. Yes you’d have to add:

    procedure TCustomerEditForm.FormCreat(Sender: TObject);
    begin
       StandardizeForm(Self); //Pay your taxes!
       ...
    end;
    

    But it’s worth it for me.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application written in Delphi 2006 that was working fine in Windows
I have an application written in Delphi 7 which does not require an admin
I have a console application written in Delphi. I saw that I can have
I have a MDI application written in Delphi 2007. If the user exits a
I have an older application (written in Delphi 6) that has to be ported
We've got this large application written in Delphi 5, and development is ongoing to
I have a Client/Server application written Delphi. Essentially all the application is doing is
I have an application written in Delphi W32 that is in beta. On the
HI I have an application written in Delphi 2006. I have noticed that when
Lets say I have an intraweb application (written in Delphi 2010) with an iwEdit

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.