?
Solved

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

Posted on 1998-02-11
3
Medium Priority
?
454 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 200 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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying 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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
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…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses

807 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