Solved

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

Posted on 1998-02-11
3
442 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
Comment Utility
Edited text of question
0
 
LVL 1

Accepted Solution

by:
millerw earned 50 total points
Comment Utility
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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
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…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

772 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

10 Experts available now in Live!

Get 1:1 Help Now