Solved

Sizing forms during runtime when screen resolution is different from one used during designing.

Posted on 1998-02-11
3
447 Views
Last Modified: 2013-12-03
Back again for some expert advice and possible a small example of how to fix the following problem..

How can I during runtime handle the  change of screen resolution and fontsize  when it changes from what I designed the application and still maintain approximately the same size of the form

I have tried the borland Ti2861 Technical Information (Form display  with different resolutions) but when I compile the application and then run it under a different resolution the following happens:
 
(800 by 600 Large Font)  to (640 by 480 Small Font)  the form blows up to fill the whole screen and all components are distorted..

Or when I go from (800 by 600 Large Font) to (800 by 600 Small Font)  the form is reduced to 1/2 of it original size.

Help what am I doing wrong or have I totally messed up in my understanding of the borland technical information.

 
0
Comment
Question by:delbrad
3 Comments
 

Author Comment

by:delbrad
ID: 1359055
Edited text of question
0
 
LVL 1

Accepted Solution

by:
millerw earned 50 total points
ID: 1359056
This question has already been asked.  

But, here you go:

http://delphi.lehner.at/faqs.htm

Download Lloyd's helpfile and read it.  Do what he tells you to do to resolution independent forms.

My best results have come by just making sure everything is Aligned (Top, bottom, left, right, client) and then just transporing from one computer to another.  It works fine for me.

I didn't have much luck with his font stuff, so i use the align and Scaled=False.  Then the computer figures it out for you.

Good Luck,
Scott
0
 

Expert Comment

by:zitt
ID: 1359057
NOTE: This applies to only Delphi 1.

If you have DELPHI source, you might try this fix.

Excerpt from Delphi Bug Lists are maintained by Reinier Sterkenburg:

The property access method SetWidth has a bug, when using a screen resolution with Large Fonts.

Description:
When your screen is configured in a high resolution with Large Fonts, setting the size of a TMetafile object makes its width too large.
This is caused by the fact that in the SetWidth method of TMetafile, a division by 96 is done, where the expression shpuld be divided by Screen.PixelsPerInch (in many cases the value is 96, but it can also be 120).

Solution:
When you have the VCL source, change the line (unit Graphics, procedure TMetafile.SetWidth)
      Value := MulDiv(Value, FInch, 96);
to
      Value := MulDiv(Value, FInch, Screen.PixelsPerInch);

0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

791 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question