Solved

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

Posted on 1998-02-11
3
443 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
how to center only a line in richedit? 4 51
Delphi Mdi application Child forms get behind control 7 151
Convert a string into a TDateTime 5 50
How are Button Fonts Created? 2 15
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
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…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

943 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

Need Help in Real-Time?

Connect with top rated Experts

5 Experts available now in Live!

Get 1:1 Help Now