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 9246923
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T09:36:26+00:00 2026-06-18T09:36:26+00:00

I develop a legacy Delphi 6 application, and I would like to increase the

  • 0

I develop a legacy Delphi 6 application, and I would like to increase the font size of one of the forms. All other forms have Microsoft Sans Serif 8pt, but this one is set to Microsoft Sans Serif 7pt. All controls have ParentFont = True, so I could simply set the font size of the form to 8pt. The problem is that the form and its controls won’t resize, and the text of the labels would overlap. Is there a simple way to resize the form after resizing its font, without resizing its controls manually in the form editor?

  • 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-06-18T09:36:27+00:00Added an answer on June 18, 2026 at 9:36 am

    At designtime you can effect the change by editing the .dfm file manually. Make sure that the form is saved with the Scaled property set to True.

    Then, close your project in Delphi, or close Delphi altogether. Next open the .dfm file in a text editor and adjust the forms TextHeight property. For example, if you want to scale from 7pt to 8pt, and TextHeight is set to 13, then you should change it to 11. Then re-load the project and open the form in the designer and your form will be scaled. This won’t be a perfect scaling because you aren’t allowed floating point values for TextHeight. But it may be good enough.


    At runtime, you can to call ChangeScale:

    ChangeScale(NewFont.Size, OldFont.Size);
    

    Note that ChangeScale is a protected member. So, depending on where you are calling this, you may need to use the protected member hack.

    One option then would be to call the form persistence framework at runtime to generate a scaled version of the .dfm file. That would allow you more precise control than playing tricks with TextHeight

    For example, you can attach the following to the OnShow event of your form:

    procedure TMyForm.FormShow(Sender: TObject);
    var
      BinaryStream, TextStream: TStream;
    begin
      BinaryStream := TMemoryStream.Create;
      Try
        BinaryStream.WriteComponent(Self);
        BinaryStream.Position := 0;
        TextStream := TFileStream.Create('MyForm.dfm', fmCreate);
        Try
          ObjectBinaryToText(BinaryStream, TextStream);
        Finally
          TextStream.Free;
        End;
      Finally
        BinaryStream.Free;
      End;
    end;
    

    This will generate a new .dfm file based on the runtime state. You can then compare this with the version of the .dfm file that is in your revision control system. There will be a few changes that you won’t want to accept, but mostly the changes will be the position and size changes that you do want.

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

Sidebar

Related Questions

I have the 'luck' of develop and enhance a legacy python web application for
I have a messy Delphi 7 legacy system to maintain and develop. I am
I have to develop extension for legacy application that relies on com objects. My
I develop application for APNS. My code is work fine with one device and
I develop one book reader application which play audio according to page, but problem
We have a legacy server code that we want to abandon and develop new
I have a chance to start porting a legacy application written in C++/Powerbuilder to
We have some legacy code that compiles in Delphi 6. There are plans to
At our company all the developers have local admin rights. But now one of
I have an application that I develop in Silverlight and it must connect to

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.